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
Unknown Object (File)
Wed, Aug 20, 8:29 AM
Unknown Object (File)
Mon, Aug 11, 5:57 PM
Unknown Object (File)
Jul 5 2025, 8:46 AM
Unknown Object (File)
Jul 2 2025, 2:57 AM
Unknown Object (File)
Jun 30 2025, 4:22 PM
Unknown Object (File)
Jun 16 2025, 3:50 PM
Unknown Object (File)
Jun 16 2025, 12:02 AM
Unknown Object (File)
Jun 4 2025, 3:00 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.