Re: Recent changes to sysctl.h breaks glibc

Sam Ravnborg (sam@ravnborg.org)
Mon, 19 May 2003 18:56:23 +0200


On Mon, May 19, 2003 at 02:06:18PM +0100, Christoph Hellwig wrote:
> On Mon, May 19, 2003 at 02:56:25PM +0200, Martin Schlemmer wrote:
> > Point is just that people like you keep on bitching about not
> > using sanitized kernel headers, but do nothing about it, or
> > until today have said nothing about 'sanitized headers'.
>
> Why don't you just get the glibc-kernheaders package from rawhide
> (or the equivalent from your prefered distribution) and stop
> complaining?

Since this is brought up againg.

Today we have:
include/asm-<arch>
include/linux
include/<subsystem>

Within include/linux grep told me that "#ifdef __KERNEL__" was present
in 219 places. So a lot of header files are kept in a shape that allows
them to be included from user-land.

I see two possible solutions here:
1) Automate the process of creating sanitized user-land headers.
- It should be a trivial task to do - but will require some effort
to be done right. Does any tool exist to do it today?
Automation allows glibc to user kernel headers for a recent
kernel without looking up a distribution specific set of header
files somewhere.

Dave M brougt up one issue the other day, when he added a new define
to a header file. No need to wait for a distribution to pick up.

2) Create a user level hirachy under include/ [obviously 2.7 material]

include/linux/user
include/<subsystem>/user
include/asm-<arch>/user

In reality we will see a lot of files in include/linux that looks like:

sched.h:
part 1 - all relevant includes:
#include <linux/.....>
...
part 2 - user level interface
#include <linux/user/sched.h>

part 3 - kernel specific definitions.
extern rwlock_t tasklist_lock;
extern spinlock_t mmlist_lock;

I am well aware that by default glibc shall NOT use kernel headers.
But IMHO it is too difficult to upgrate to a new version of the kernel
headers.

Care to explain what is wrong with the above approaches - I may have
missed something obvious.

Sam

-
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/