Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Apr 1998 22:03:14 -0700 (PDT)
From:      Julian Elischer <julian@whistle.com>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG, cvs-sys@FreeBSD.ORG, des@FreeBSD.ORG
Subject:   Re: cvs commit: src/lib/libc/sys lseek.2 src/sys/kern vfs_syscalls.c
Message-ID:  <Pine.BSF.3.95.980418220215.22408A-100000@current1.whistle.com>
In-Reply-To: <199804190300.NAA15945@godzilla.zeta.org.au>

next in thread | previous in thread | raw e-mail | index | archive | help
If this is truely 'common' then that's unfortunate.
what do POSIX and friends have to say about it?


On Sun, 19 Apr 1998, Bruce Evans wrote:

> >des         1998/04/18 12:24:45 PDT
> >
> >  Modified files:
> >    lib/libc/sys         lseek.2 
> >  Log:
> >  Return EINVAL and do not changefile pointer if resulting offset is negative.
> >  PR:		kern/6184
> >  
> >  Revision  Changes    Path
> >  1.7       +2 -2      src/lib/libc/sys/lseek.2
> >
> >  Modified files:
> >    sys/kern             vfs_syscalls.c 
> >  Log:
> >  Return EINVAL and do not change file pointer if resulting offset is negative.
> >  PR:		kern/6184
> 
> This is wrong.  Please back it out.  It breaks at least the ability to
> seek to high addresses in /dev/[k]mem on 64 bit systems.  Not long ago
> when off_t was 32 bits, it was normal to seek to "negative" addresses in
> /dev/kmem, so portable programs should be able to handle such addresses
> at least if they actually request them.  libkvm/kvm_proc.c:kvm_uread()
> shows how to handle them:
> 
> 	errno = 0;
> 	if (lseek(fd, (off_t)uva, 0) == -1 && errno != 0) {
> 		/* Error. */
> 		...
> 	}
> 	/* No error. */
> 	...
> 
> This allows seeking to (off_t)-1 provided the system supports it.
> 
> I replied to the PR, but for some reason the followup didn't get attached
> to the PR.
> 
> Bruce
> 


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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.980418220215.22408A-100000>