Porting ncpfs utils. to libc6

Eloy A. Paris (eparis@ven.ra.rockwell.com)
Wed, 26 Nov 1997 21:44:11 -0400 (VET)


Hi!

I found it!!! I got ncpmount and ncpumount working under libc6!

Nothing was wrong with the kernel and nothing was wrong with mount. It
was just that the sizes of some data types in libc5 and in libc6 are
different!!! Shut!!! Almost one month wasted because of this!

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

You see? The problem is that the ncpfs utilities are very close to the
kernel data structures, as you said before.

I think a major rewrite of the #include's of all ncpfs utilites must
be done. I'll try to do it and send my patches to you when I am done.
I need to figure out a way of doing this without breaking anything
else.

I bet whatever you want that I'll find the _same_ problems when I try
to port the smbfs utilities to libc6 :-)

Well, enough for today. I'm going home. It's been a long day.

See ya!

E.-

-- 

Eloy A. Paris Information Technology Department Rockwell Automation de Venezuela Telephone: +58-2-9432311 Fax: +58-2-9431645