From owner-cvs-sys Sat Apr 18 20:05:45 1998 Return-Path: Received: (from daemon@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA00961 for cvs-sys-outgoing; Sat, 18 Apr 1998 20:05:45 -0700 (PDT) (envelope-from owner-cvs-sys) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA00956; Sun, 19 Apr 1998 03:05:34 GMT (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id NAA15945; Sun, 19 Apr 1998 13:00:06 +1000 Date: Sun, 19 Apr 1998 13:00:06 +1000 From: Bruce Evans Message-Id: <199804190300.NAA15945@godzilla.zeta.org.au> To: 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 Sender: owner-cvs-sys@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >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