This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: One serious bug in glibc 2.0/2.1


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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]