HomeFreeBSD

rc.subr: Implement list_vars without using 'read'

Description

rc.subr: Implement list_vars without using 'read'

'read' pessimistically read(2)s one byte at a time, which can be quite
silly for large environments in slow emulators.

In my boring user environment, truss shows that the number of read()
syscalls to source rc.subr and invoke list_vars is reduced by something like
3400 to 60. ministat(1) shows a significant time difference of about -71%
for my environment.

Suggested by: jilles
Discussed with: dteske, jhb, jilles
Differential Revision: https://reviews.freebsd.org/D18481

Details

Provenance
cemAuthored on
Differential Revision
D18481: rc.subr: Implement list_vars without using 'read'
Parents
rS341802: Validate the string size parameter passed to -s.
Branches
Unknown
Tags
Unknown