Re: bitops.h ifdef __KERNEL__ cleanup.

From: David Woodhouse (dwmw2@infradead.org)
Date: Thu Jul 19 2001 - 16:53:32 EST


VANDROVE@vc.cvut.cz said:
> If you do not want kernel headers to be used in apps, just move them
> from asm and linux into msa and xunil. Then you can simple remove all
> #ifdef __KERNEL__ from them...

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
offer.

> P.S.: Part of ncpfs's configure.ac. I do not think that it is that
> hard...

I'm not very familiar with autoconf, but doesn't the snippet you pasted just
check that the program compiles and links? It won't notice if you build a
binary with privileged instructions in, or one which just fails to provide
the correct semantics when the routine is used in a environment for which
it was not designed?

Where is this used in ncpfs that it makes _such_ a difference?

--
dwmw2

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 23 2001 - 21:00:12 EST