From owner-cvs-all Sat Apr 18 22:17:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA14495 for cvs-all-outgoing; Sat, 18 Apr 1998 22:17:33 -0700 (PDT) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA14288; Sun, 19 Apr 1998 05:17:13 GMT (envelope-from julian@whistle.com) Received: (from daemon@localhost) by alpo.whistle.com (8.8.5/8.8.5) id WAA23995; Sat, 18 Apr 1998 22:08:31 -0700 (PDT) Received: from current1.whistle.com(207.76.205.22) via SMTP by alpo.whistle.com, id smtpd023993; Sun Apr 19 05:08:30 1998 Date: Sat, 18 Apr 1998 22:03:14 -0700 (PDT) From: Julian Elischer To: Bruce Evans 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 In-Reply-To: <199804190300.NAA15945@godzilla.zeta.org.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk 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