Re: Porting ncpfs utils. to libc6

Raja R Harinath (harinath@cs.umn.edu)
26 Nov 1997 21:27:17 -0600


"Eloy A. Paris" <eparis@ven.ra.rockwell.com> writes:
> Look at this: under libc5 the following data types are 16 bits wide (2
> bytes): uid_t, gid_t and mode_t. Under libc6 they are 32 bits wide (4
> bytes). Therefore, when an ncpfs utility includes a file from
> /usr/include/linux, the wrong variable size will be picked because the
> compiler already has included the file with the typedef.
>
> I have solved the problem temporaryly by doing these kind of things in
> the #include's in /usr/include/linux and in the ncpfs utilities:
>
> #ifdef HAVE_GLIBC2
> unsigned short uid;
> unsigned short gid;
> unsigned short file_mode;
> unsigned short dir_mode;
> #else
> uid_t uid;
> gid_t gid;
> mode_t file_mode;
> mode_t dir_mode;
> #endif

If the uid_t and gid_t types are meant to be the kernel types, just use
(instead of the #ifdef):

__kernel_uidt uid;
__kernel_gidt gid;
__kernel_mode_t file_mode;
__kernel_mode_t dir_mode;

This should work irrespective of libc5 or libc6.

- 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