Date: Thu, 10 Mar 2011 14:46:37 -0500 From: John Baldwin <jhb@freebsd.org> To: freebsd-arch@freebsd.org Cc: mdf@freebsd.org Subject: Re: style(9) rules for nested includes Message-ID: <201103101446.37589.jhb@freebsd.org> In-Reply-To: <AANLkTikqBJON46-EJFPPktT82L8dgX6dwwDrxWwFqumU@mail.gmail.com> References: <AANLkTikqBJON46-EJFPPktT82L8dgX6dwwDrxWwFqumU@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, March 10, 2011 12:17:28 pm mdf@freebsd.org wrote: > I recall a recent discussion/PR about nested includes in the context > of <sys/linker_set.h> and <sys/queue.h> being a few of the only ones > allowed. However, I don't see anything in style(9) about this. bde@ is probably the most authoritative. My understanding is that the only nested includes allowed in sys/sys/*.h are the two listed above and any header that starts with an underscore (sys/_mutex.h, etc.). The underscore variants were added to allow nested includes when absolutely necessary, but those includes are the bare minimum required to define structures, etc. > Now we come to the reason I ask. I'm working on a patch to change the > static sysctl code to use the standard SYSININT/SYSUNINIT code rather > than have special treatment in kern_linker.c, but to do this I need to > either change quite a few places that include <sys/sysctl.h>, or > include <sys/kernel.h> instead of <sys/linker_set.h> in sysctl.h, as > the SI_SUB_SYSCTLS value isn't visible otherwise. Hmm, what is the reason to use SYSINIT's instead of a dedicated linker set? -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103101446.37589.jhb>