One serious bug in glibc 2.0/2.1

Andreas Schwab schwab@issan.informatik.uni-dortmund.de
Fri Aug 7 04:10:00 GMT 1998


hjl@lucon.org (H.J. Lu) writes:

|> Hi,
|> 
|> There is one serious bug in glibc 2.0/2.1 in dealing with system
|> calls. glibc assumes system calls returns int. That may be true on
|> x86. But it is not always true on alpha where int is 4 byte and
|> long is 8 byte. Some system calls return long instead of int. Those
|> system calls are those which return offset or address. At least, lseek
|> is not handled right on alpha. Return -1 as long turns into -1 as int
|> which is 0xffffffff in long. We should go over all those system calls
|> and fix them.

Isn't it the resposibility of the PSEUDO macro in sysdep.h to get things
right?  On m68k where pointers are returned in %a0 instead of %d0 this
works ok.  I don't see where the return type of int is hardcoded, except
in syscall(), but that is unreliable anyway.

-- 
Andreas Schwab                                      "And now for something
schwab@issan.informatik.uni-dortmund.de              completely different"
schwab@gnu.org



More information about the Libc-hacker mailing list