Re: include file conflict

Guest section DW (dwguest@win.tue.nl)
Sun, 15 Nov 1998 00:21:48 +0100 (MET)


I am willing to clean up the kernel headers with proper #ifdef __KERNEL__
and #ifdef __KERNEL_STRICT_NAMES, but I'd like to know that my work will
have some finality. Would such patches be accepted still in 2.1 or am I
wasting my time?

Ion

Everyone who uses <linux/foo.h> is going to be bitten.

This has been true for years, and will remain true,
regardless of whether you put the proper #ifdef __KERNEL__
incantations into the kernel headers.
Thus, (1) it is a good idea to improve the kernel sources a bit,
but (2) you are wasting your time in the sense that a week
or a month after you improved the includes something
will be changed, and your programs will not compile anymore.

... Obviously, anything bypassing the libc
interface needs to use kernel protocols, data type, data structures, etc.

That is not obvious at all. A grave mistake, in fact.
The kernel presents an API to the outside world.
Whatever the kernel does internally is none of your business,
and will change from week to week. But the API remains fairly
stable, with features being added but not changed.

And -- Linus knows this fact well, and uses it at times -- a compile error
due to a header file that changed is much preferrable to a silent data
corruption from an application that compiled correctly with its own headers.

You make the mistake of thinking that people run their programs
under the same kernel as these programs are compiled under.
But that is false. People switch back and forth between 2.0.* and 2.1.*,
upgrade kernels every now and then, without recompiling all
their utilities. Indeed, most utilities from 1992 function fine today.

Well-written source compiles under all sufficiently recent libraries
and functions under all sufficiently recent kernels, including
those of next week.

Everyone who uses <linux/foo.h> is going to be bitten.

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