Use of bool / stdbool.h in kernel

mdf at FreeBSD.org mdf at FreeBSD.org
Tue Nov 29 18:09:28 UTC 2011


At $WORK we have a hack in one of the *.mk files to allow including
stdbool.h in the kernel and we use it extensively.  This is not
allowed by style(9), as far as I can tell, because the file is in
include/stdbool.h and those files are not allowed to be included in
kernel sources.

What I want to check on is, would it be acceptable to move stdbool.h
from include/stdbool.h to sys/sys/stdbool.h (i.e. like errno.h) and
then include it in the kernel as <sys/stdbool.h>?  That is, is the
objection / non-use because of where the file is located in the
repository, or is there some other reason?  Note that the pre-C99
boolean_t and TRUE/FALSE are spread over the kernel, mostly in sys/vm
where I assume they come from old AT&T sources.

Thanks,
matthew


More information about the freebsd-arch mailing list