Re: [RFC] Splitting out kernel<=>userspace ABI headers

From: H. Peter Anvin
Date: Wed Sep 14 2005 - 12:02:04 EST


Sam Ravnborg wrote:


The kernel predates C99, sort of, and it would be a massive but valuable task to figure out where a type is really, for instance, 32 bits rather than "size of default int" in length, etc, and use POSIX types where they are correct. Fewer things to maintain, and would make it clear when something is 32 bits by default and when it really must be 32 bits.

This has been discussed several times on lkml.
Ask google...
In short - the kernel provide its own namespace, and here __u32 etc is
used. And starting to change that would be a noisy effort with no or
limited gain neither for the kernel nor userspace.


More specifically, replacing u32 with uint32_t as the kernel-internal type would be fine and arguably useful; in fact, a handful of drivers I believe already use it.

Replacing __u32 with uint32_t would be wrong, because it would require some user space headers that cannot include <stdint.h> to have to do so. POSIX has *very* specific rules for namespace pollution, and most libcs have to care about that (klibc doesn't, but it's an exception, not the rule.)

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