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

From: H. Peter Anvin
Date: Sat Sep 03 2005 - 10:22:56 EST


Erik Andersen wrote:

That is certainly not what I was proposing. Why are you bringing
sys/stat.h into this? The contents of sys/stat.h are entirely up
to SUSv3 and the C library to worry about. Nobody has proposed
mucking with that. I dunno about your C library, but mine
doesn't include linux/* header files (not even sys/stat.h). And
I'd really like to fix uClibc to not use any asm/* either, since
much of it is entirely unsuitable for user space.


That's the whole problem here, isn't it, so let's fix it the sane way instead of putting Descartes before Dehorse.

Anyway, to answer your implied question is: since I explicitly don't have to worry about forward ABI compatibility, I expose the kernel ABI raw. Thus I want to be able to use the kernel ABI directly, including for things like struct stat. It poses a particularly interesting problem, actually, because the real stat system call is called stat64 on most platforms.

Thus, an ABIzed <linux/abi/stat.h> or whatever it's called might export "struct __kabi_stat" and "struct __kabi_stat64" with the expectation that the caller would "#define __kabi_stat64 stat" if that is the version they want. A typedef isn't good enough for C, since you can't typedef struct tags.

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