Page MenuHomeFreeBSD

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

Authored by jhb on Jan 4 2023, 10:56 PM.
Tags
None
Referenced Files
F102660024: D37950.id114761.diff
Fri, Nov 15, 11:56 AM
F102654427: D37950.diff
Fri, Nov 15, 9:59 AM
Unknown Object (File)
Sun, Nov 10, 9:37 PM
Unknown Object (File)
Mon, Nov 4, 12:49 AM
Unknown Object (File)
Oct 3 2024, 4:36 PM
Unknown Object (File)
Oct 3 2024, 2:58 PM
Unknown Object (File)
Oct 1 2024, 9:43 PM
Unknown Object (File)
Oct 1 2024, 4:37 PM
Subscribers

Details

Summary

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
<sys/queue.h>.

Sponsored by: DARPA
Obtained from: CheriBSD

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
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.