Re: Ok, making ready for pre-2.4 and code-freeze..

Tigran Aivazian (tigran@sco.COM)
Tue, 21 Dec 1999 16:13:32 +0000 (GMT)


On Tue, 21 Dec 1999, Rogier Wolff wrote:
> Tigran Aivazian wrote:
> > > The return code for unix system calls should be defined as "negative"
> > > for error, and not "-1".
> >
> > I beg to differ because lseek(2) has the right to return negative offsets
> > on some implementations (of UNIX) on some architectures (notably i386).
>
> I beg to differ: lseek has no right to return a position before the
> start of the file.
>
> * Upon successful completion, lseek returns the resulting
> * offset location as measured in bytes from the beginning of
> * the file.
>
> Maybe, some OSes are "breaking the rules" a bit by allowing larger
> files than a 31-bit return value for lseek(2) allows, but that's their
> problem.

Dear Rogier,

have a look at Stevens' APUE, the page that describes lseek(2) (it is not
at hand and I can't remember page number) it will tell you which
particular flavour (AT&T SVR3 or something similar) did that. I definitely
(but vaguely, 5-6 years ago or so) remember situations where negative
offsets off /dev/kmem were valid and useful.

Regards,
Tigran.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/