Re: kern/6184: No error if resulting file pos in lseek is negative

[ Available lists | Index of freebsd-bugs | Month of Sep 1999 | Week of 7 Sep 1999 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Bruce Evans <bde@FreeBSD.ORG>
Date
7 Sep 1999 10:01:30
Subject
Re: kern/6184: No error if resulting file pos in lseek is negative
Message-ID
19990907170129.D163214C29@hub.freebsd.org

In reply to

[ Hide this part ]
>  Any reason why this shouldn't go into -current?  If there aren't any

Yes, it breaks seeking to half of the address space in /dev/mem and
dev/kmem on 64-bit machines.

The maximum value for an lseek() offset depends on the file. I think
POSIX indirectly requires checking against the limit at lseek() time, at
least for regular files, since there is no Standard way for read(2) to
report failure due to an invalid offset (FreeBSD documents returning
EINVAL, but ufs actually returns EFBIG). Applications still need to
be careful about seeking to (off_t)-1 if they actually want to do this,
since (off_t)-1 may be a valid seek offset.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Elapsed time: 0.095 seconds