Re: libc6 and the Linux kernel
"Eloy A. Paris" <eparis@ven.ra.rockwell.com> writes:
> today I found why I was having so many problems when trying to port
> the ncpfs utilities to libc6: the userland ncpfs utilities use some
> data types like uid_t, gid_t, etc. that the kernel also uses.
>
> Under libc5 these data types are of one size but under libc6 they have
> a different size (for example uid_t is 2 bytes long in libc6 but 4
> bytes long in libc6).
>
> Since the kernel is using libc5 include files, the size of its
> variables will be different from the size of variables of the same
> type in the userland programs compiled for libc6.
Rather, `libc5' is using the kernel include files.
> I think I know how to fix userland programs to make them able to work
> with both libc6 _and_ the kernel but my question is:
>
> is this likely to change in the future? I mean, will the Linux kernel
> use at some time in the future libc6 include files so the both the
> kernel and the userland utilities share the same data types (and its
> sizes)?
Note that the kernel is pretty self-contained. In particular it should
_not_ use any part of libc. So, the kernel does _not_ use the libc5
headers, and will _not_ use the libc6 headers.
If you want to write POSIX code, you can use the opaque types uid_t,
gid_t, &c. If you want to specifically use the kernel types, say so, by
using the __kernel_ prefix. You can get at these types with
#include <sys/types.h> /* or #define __KERNEL_STRICT_NAMES */
#include <linux/types.h>
and using `__kernel_uid_t', `__kernel_gid_t' &c. Note that this should
work both for `libc5' and `libc6', and recent kernels.
- Hari
--
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions." -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing." -- Roy L Ash
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: