All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: Bryan Henderson <hbryan@us.ibm.com>
Cc: linux-fsdevel@vger.kernel.org,
	Paul Taysom <Paul.Taysom@novell.com>,
	viro@www.linux.org.uk
Subject: Re: negative seek offsets in VFS
Date: 30 May 2005 11:36:44 +0200
Date: Mon, 30 May 2005 11:36:44 +0200	[thread overview]
Message-ID: <20050530093644.GI86087@muc.de> (raw)
In-Reply-To: <OF5D92EB2B.6BFD646E-ON8825700E.0064A49C-8825700E.006682A1@us.ibm.com>

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

  parent reply	other threads:[~2005-05-30  9:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <s29588e0.089@sinclair.provo.novell.com>
2005-05-26 17:49 ` negative seek offsets in VFS Bryan Henderson
2005-05-26 19:23   ` Andi Kleen
2005-05-26 21:17     ` Bryan Henderson
2005-05-27 10:43       ` Andi Kleen
2005-05-27 18:39         ` Bryan Henderson
2005-05-28 12:41           ` Jamie Lokier
2005-05-31 18:08             ` Bryan Henderson
2005-05-30  9:36           ` Andi Kleen [this message]
2005-05-31 18:33             ` Bryan Henderson
2005-05-28 12:37         ` Jamie Lokier
2005-05-30  9:32           ` Andi Kleen
2005-05-26 14:29 Paul Taysom
  -- strict thread matches above, loose matches on Subject: below --
2005-05-25 16:39 Andi Kleen
2005-05-25 16:56 ` Trond Myklebust
2005-05-25 18:48   ` Andi Kleen
2005-05-26  0:56 ` Bryan Henderson
2005-05-26 19:20   ` Andi Kleen
2005-05-26 15:15 ` Al Viro
2005-05-26 15:29   ` Linus Torvalds
2005-05-26 19:25     ` Andi Kleen
2005-05-26 19:39       ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050530093644.GI86087@muc.de \
    --to=ak@muc.de \
    --cc=Paul.Taysom@novell.com \
    --cc=hbryan@us.ibm.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@www.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.