Page MenuHomeFreeBSD

<sys/sysctl.h>: Reduce overly broad header pollution.

Authored by jhb on Jan 4 2023, 10:56 PM.
Referenced Files
Unknown Object (File)
Fri, Mar 24, 9:43 PM
Unknown Object (File)
Sat, Mar 18, 6:19 AM
Unknown Object (File)
Thu, Mar 9, 9:10 PM
Unknown Object (File)
Jan 28 2023, 10:40 PM
Unknown Object (File)
Jan 19 2023, 6:59 PM



Commit d3f96f661050e9bd21fe29931992a8b9e67ff189 removed <sys/queue.h>
and replaced it with the very broad <sys/systm.h>. However, none of
the changes to sysctl.h in that commit require anything defined in
<sys/systm.h>. On the other hand, <sys/sysctl.h> does still make use
of queue macros. Drop the include of <sys/systm.h> and re-add

Sponsored by: DARPA
Obtained from: CheriBSD

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Jan 4 2023, 10:56 PM

In CheriBSD the <sys/systm.h> nested include introduced a circular dependency since we have a local header included in <sys/systm.h> that uses SYSCTL_DECL_NODE(). However, I can't really see why <sys/systm.h> was added in the original change either.

This revision is now accepted and ready to land.Jan 5 2023, 2:44 AM

LGTM. It looks like I included sys/systm.h because an earlier, pre-phabricator version of the change included a panic() within cmp_sysctl_oid, but then I forgot to revert the header change.