Bruce Dubbs wrote: > I'm not sure I completely understand. Is Linus saying that it is up > to the interface library to *copy* the needed data structures (not > including) from the kernel to their own set of public headers?
Yes. > If so, is this because the kernel devs don't know what definitions > are needed by the interface library? I don't think it's entirely that. I think it's partly because the C library needs to follow a lot of naming rules and other stuff that the kernel will not (and should not have to) follow. For instance (again), flock.h -- in glibc, the behavior of all the stdio stuff changes if you ask for large file support. The size of "struct flock", for one, is different. But in the kernel, it's just two different sets of system calls, each using its own structure size; it's glibc that's adding the abstraction there. The reason is so that a program can change its behavior by merely adding a #define before including glibc headers, assuming everything else is correct (fpos_t usage instead of "int", etc.). This abstraction barrier is a good one; programs should not have to be changed so extensively when all they want is large file support. But the kernel has to support both, so its headers have to *avoid* the compile-time decision making. The kernel interface headers have to support both system call families and both structure sizes. The other part of the objection, I think, is that the kernel devs really don't know what the public interface of glibc should look like, nor should they care. The public interface of glibc (the headers that it installs) are defined by SUS, POSIX, and a bunch of other standards; the kernel has to have some way of allowing each of the POSIX operations, but it does not have to follow the POSIX naming on all the structure members, etc. (That's what glibc is *for*, after all -- changing system calls defined by the POSIX spec into whatever the underlying kernel can handle. If the name of a field in a struct changes, no big deal, as long as the size of things doesn't change.)
signature.asc
Description: OpenPGP digital signature
-- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page