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)
Dec 22 2023, 11:37 PM
Unknown Object (File)
Nov 9 2023, 9:32 AM
Unknown Object (File)
Nov 6 2023, 4:25 PM
Unknown Object (File)
Nov 5 2023, 4:26 AM
Unknown Object (File)
Oct 15 2023, 10:19 PM
Unknown Object (File)
Oct 8 2023, 8:20 AM
Unknown Object (File)
Oct 7 2023, 12:24 PM
Unknown Object (File)
Oct 5 2023, 3:22 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib added inline comments.
usr.bin/getconf/getconf.c
213 ↗(On Diff #33082)

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 ↗(On Diff #33082)

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 ↗(On Diff #33082)

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.