Page MenuHomeFreeBSD

Add an -a flag to getconf.
ClosedPublic

Authored by jhb on Sep 14 2017, 5:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 9, 3:00 PM
Unknown Object (File)
Oct 31 2024, 5:52 AM
Unknown Object (File)
Oct 24 2024, 6:41 PM
Unknown Object (File)
Sep 24 2024, 2:47 AM
Unknown Object (File)
Sep 21 2024, 10:42 PM
Unknown Object (File)
Sep 21 2024, 8:48 AM
Unknown Object (File)
Sep 21 2024, 5:37 AM
Unknown Object (File)
Sep 10 2024, 3:58 PM
Subscribers
None

Details

Summary

When -a is specified, the name and value of all system or path configuration
values is reported to standard output.

Linux's getconf supports -a, but only for system variables according to the
manual page.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 11599
Build 11952: arc lint + arc unit

Event Timeline

kib added inline comments.
usr.bin/getconf/getconf.c
213

Why err() there, while other do_oneXXX() only warn() about error ? Is this for situations like ENOENT where the path is nonexistent ? I am not sure that other situations are impossible in principle where some parameter gives !EINVAL error.

IMO user deserves the fallout there.

usr.bin/getconf/pathconf.gperf
78

I would prefer to have the multi-line loop body braced.

This revision is now accepted and ready to land.Sep 14 2017, 8:08 PM
usr.bin/getconf/getconf.c
213

Yes, the idea was to die once for ENOENT, but it is perhaps a bit fragile, so warn() is ok.

  • Use warn() for errors from pathconf().
  • Add braces in foreach routines.
This revision now requires review to proceed.Sep 15 2017, 10:51 PM
This revision was automatically updated to reflect the committed changes.