Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Aug 2001 14:59:59 +0400
From:      "Andrey A. Chernov" <ache@nagual.pp.ru>
To:        Joseph Koshy <jkoshy@FreeBSD.ORG>
Cc:        arch@FreeBSD.ORG
Subject:   Re: CFR: fseek<0 + feof error (with fix)
Message-ID:  <20010813145956.A75227@nagual.pp.ru>
In-Reply-To: <20010813104030.55AE437B406@hub.freebsd.org>
References:  <20010810232939.A14964@nagual.pp.ru> <20010813104030.55AE437B406@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 13, 2001 at 03:40:30 -0700, Joseph Koshy wrote:
> 
> 
> > According to POSIX fseek{o}() description, it must return
> > 
> > [EINVAL]
> >           The whence argument is invalid. The resulting file-position
> >           indicator would be set to a negative value.
> > 
> > which expicetly disallows seek beyond beginning of a file. Currently we
> 
> FreeBSD's implementation of `lseek()' allows negative offsets --- these
> seem to be required to allow reading of /dev/[k]mem.  See PR kern/6184.


We talk here about _fseek_, not about _lseek_. For lseek POSIX word are
different:

[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.

I.e. no negative offset allowed for fseek at all while it allowed for
lseek expecting regular, block special or directory file.

-- 
Andrey A. Chernov
http://ache.pp.ru/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010813145956.A75227>