This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: One serious bug in glibc 2.0/2.1
- To: "H.J. Lu" <hjl@lucon.org>, Ulrich Drepper <drepper@cygnus.com>
- Subject: Re: One serious bug in glibc 2.0/2.1
- From: Richard Henderson <rth@cygnus.com>
- Date: Sat, 8 Aug 1998 15:43:34 -0700
- Cc: rth@cygnus.com, GNU C Library <libc-hacker@cygnus.com>
- References: <m0z4R45-00038xC@ocean.lucon.org>
- Reply-To: Richard Henderson <rth@cygnus.com>
On Thu, Aug 06, 1998 at 07:30:49AM -0700, H.J. Lu wrote:
> There is one serious bug in glibc 2.0/2.1 in dealing with system
> calls. glibc assumes system calls returns int.
No it doesn't.
> At least, lseek is not handled right on alpha.
No it isn't.
> Return -1 as long turns into -1 as int which is 0xffffffff in long.
No it isn't. 32-bit integers -- signed _or_ unsigned -- are always
kept in canonical sign-extended form on Alpha.
As proof that lseek returns the proper value:
#include <unistd.h>
#include <sys/types.h>
main()
{
off_t x = lseek(-1, -1, -1);
printf("%lx\n", x);
}
does print ffffffffffffffff.
r~