From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: Re: negative seek offsets in VFS Date: 30 May 2005 11:36:44 +0200 Message-ID: <20050530093644.GI86087@muc.de> References: <20050527104311.GC86087@muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, Paul Taysom , viro@www.linux.org.uk Return-path: Received: from colin.muc.de ([193.149.48.1]:6404 "EHLO mail.muc.de") by vger.kernel.org with ESMTP id S261573AbVE3Jgs (ORCPT ); Mon, 30 May 2005 05:36:48 -0400 Date: Mon, 30 May 2005 11:36:44 +0200 To: Bryan Henderson Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Fri, May 27, 2005 at 11:39:40AM -0700, Bryan Henderson wrote: > OK, I remember that now. I probably forgot it because I couldn't think of > any use for that special range of values more negative than -4095. Can > you give an example of a system call that returns integers less than > -4095? Various ioctls for example can return arbitary values. > > And separately, I'm still confused about how you expect /dev/kmem file > offsets to work. While I was mistaken about the existence of negative > addresses, I know there are no negative file offsets in POSIX. So how > does one look at a negative address via the POSIX file interface and > /dev/kmem? pread,pwrite,lseek(...,SEEK_SET) should all work. /dev/kmem is firmly outside POSIX, so this is fine. For other devices the behaviour will not change. > > Even if you add the concept of negative file offsets as a glibc/Linux > extension of POSIX, you have an ambiguity problem at least with offset -1, > right? The kernel doesn't use this range as address, so in practice the problem does not occur. -Andi