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)
Dec 20 2023, 4:21 AM
Unknown Object (File)
Dec 12 2023, 8:01 AM
Unknown Object (File)
Oct 5 2023, 6:16 AM
Unknown Object (File)
Aug 26 2023, 8:46 AM
Unknown Object (File)
Jul 29 2023, 6:18 AM
Unknown Object (File)
Jul 6 2023, 4:41 AM
Unknown Object (File)
Jun 29 2023, 1:07 PM
Unknown Object (File)
Jun 19 2023, 12:10 AM
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.