Subject: Re: Semantics of lseek system call
To: Uwe Klaus <>
From: Michael L. VanLoon -- <>
List: current-users
Date: 11/30/1994 09:49:14
If I'm not mistaken, it goes like this...

>off_t lseek(int fildes, off_t offset, int whence)
                        64 bits

>  offset = (int)lseek(open("/netbsd", O_RDONLY, 0), -2L, SEEK_SET);
            ^^^^^                                    ^^^
           32 bits                                 32 bits

>This contradicts with the former semantics of lseek which reports the
>error EINVAL (invalid argument).
>Are these changes intended or is it a bug ?

It looks like it's a bug in your program to me...

Have you tried:

  offset = (off_t)lseek(open("/netbsd", O_RDONLY, 0), (off_t)-2, SEEK_SET);


   Michael L. VanLoon
  Free your mind and your machine -- NetBSD free un*x for PC/Mac/Amiga/etc.
     Working NetBSD ports: 386+PC, Mac, Amiga, HP300, Sun3, Sun4c, PC532
               In progress: DEC pmax (MIPS R2k/3k), VAX, Sun4m