Subject: Re: includes question
To: None <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 11/03/2002 19:09:19
> An include question:

> When I include <sys/syscall.h>, I need to include <sys/types>,
> <sys/proc.h>, <sys/param.h> ...

> There are other similar situations in kernel headers.

Userland headers too.

> Is there a reason why we don't include the requested headers for each
> kernel header file?

Inertia, near as I can tell.

I consider it a bug in foo.h if a file consisting of just
#include <foo.h>
produces compiler errors.  I've been fixing such bugs as I find them,
and have quite a list of them by now.  Quite a while ago, I sent-pr a
few of the more egregious examples and was basically told "that's not a
bug".  I wrote off trying to get NetBSD to fix them then and have just
been fixing them as part of my private patch tree.

Look for .h files in my patch tree
(ftp.netbsd.org:/pub/NetBSD/misc/mouse/patch-tree/ is the root of it)
if you're interested; most, by file count, of the .h files patched
there are just such fixes.  I haven't done any sort of methodical sweep
for them; I tried once, but there are too many "internal" files that
you should never include directly and thus to which this philosophy
does not apply.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B