Re: bitops.h ifdef __KERNEL__ cleanup.
H. Peter Anvin (firstname.lastname@example.org)
19 Jul 2001 21:18:41 -0700
Followup to: <email@example.com>
By author: David Woodhouse <firstname.lastname@example.org>
In newsgroup: linux.dev.kernel
> It has been stated many times that kernel headers should not be used in
> apps. Renaming or moving them should not be necessary - and people would
> probably only start to use them again anyway. We'd see autoconf checks to
> find whether it's linux/private.h or xunil/private.h :)
> In the absence of any expectation that userspace developers will ever obey
> the simple and oft-repeated rule that you don't use kernel headers from
> userspace, the #ifdef __KERNEL__ approach would seem to be the best on
Note that the rule is at least in part theoretical; even glibc include
kernel headers or -derivatives.
I think the idea with <asm/bitops.h> is that they are protected by
#ifdef __KERNEL__ if they are kernel-only; however, if they work in
user space then there is no #ifdef and autoconf can detect their
<email@example.com> at work, <firstname.lastname@example.org> in private!
"Unix gives you enough rope to shoot yourself in the foot."
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to email@example.com
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/