Add sysconf(8) and libbsdconf(3)Complete the native configuration trinity: sysctl(8) for live kernelstate, sysrc(8) for rc.conf(5), and sysconf(8) for the remaining baseconfiguration -- loader.co
Add sysconf(8) and libbsdconf(3)Complete the native configuration trinity: sysctl(8) for live kernelstate, sysrc(8) for rc.conf(5), and sysconf(8) for the remaining baseconfiguration -- loader.conf(5), sysctl.conf(5), and the make.conf(5)family -- atop libbsdconf(3).libbsdconf resurrects figpar as a unified reader/writer. Callbacks ownsemantics; statements may span multiple lines via backslash continuation;non-seekable input is spooled; writes are atomic (mkstemp, fsync, rename)with mode/owner preservation. Format descriptors name each target, itsfiles, and quoting rules without private parsers. Multi-file targetsfollow boot sourcing order; loader chases loader_conf_files as the bootloader does.sysconf(8) is the operator-facing tool: name / name=value on a requiredtarget, sysrc-style list edits, make append and list-strike where theybelong, jail/altroot, and a capsicum sandbox for read-only use.Sysctl writes validate against the running kernel first -- unknown andread-only OIDs, CTLFLAG_TUN (pointing at the loader target), and CTLTYPErange checks -- so a typo or overflow does not land in sysctl.conf.Make and src treat WITH_/WITHOUT_ as presence knobs (as bsd.mkopt.mk /src.conf(5) do) and warn on the WITH_*=no form that does not disable theoption, so a bad assignment is caught before an /usr/src build surfacesit.The rc target passes through to sysrc(8).Defaults querying (-d/-D/-A) mirrors sysrc for dumps and descriptions ontargets that have a defaults file; named reads already see defaults, and-A only widens dump scope.Manuals are split pkg(8)-style (bsdconf/put/format; sysconf plusper-target pages). ATF coverage exercises the frontend.Co-authored-by: Faraz Vahedi <kfv@FreeBSD.org>Reviewed by: fuz, kfvDifferential Revision: https://reviews.freebsd.org/D58066
show more ...