mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andries.Brouwer@cwi.nl
To: adilger@clusterfs.com, tomaz.susnik@hermes.si
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.4.18 kernel lseek() bug
Date: Sat, 15 Jun 2002 16:20:11 +0200 (MEST)	[thread overview]
Message-ID: <UTC200206151420.g5FEKBF25783.aeb@smtp.cwi.nl> (raw)

    >      a call to lseek() fails with EINVAL under the following conditions:
    >         - it is called on a disk device file
    >         - required offset is larger than the target disk device size

    Is this behaviour mandated in a standard, or is it just different from
    previous behaviour?  I'm not saying it _isn't_ a bug, but I don't see
    how seeking past the end of a block device is very useful.

I know many programs that use this. They seek and do not expect
an error, because the standard says no error is to be expected,
and then try to read or write.

Let me quote POSIX 1003.1-2001.

...
The lseek() function shall allow the file offset to be set beyond the
end of the existing data in the file.
...

[EINVAL] 
          The whence argument is not a proper value, or the resulting
          file offset would be negative for a regular file, block special
          file, or directory. 


Andries

             reply	other threads:[~2002-06-15 14:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-15 14:20 Andries.Brouwer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-06-17  8:02 Tomaz Susnik
2002-06-14 13:07 Tomaz Susnik
2002-06-15  3:37 ` Andreas Dilger

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=UTC200206151420.g5FEKBF25783.aeb@smtp.cwi.nl \
    --to=andries.brouwer@cwi.nl \
    --cc=adilger@clusterfs.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tomaz.susnik@hermes.si \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®