From owner-freebsd-arch Mon Aug 13 4: 0: 9 2001 Delivered-To: freebsd-arch@freebsd.org Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by hub.freebsd.org (Postfix) with ESMTP id 97BDB37B40B; Mon, 13 Aug 2001 04:00:05 -0700 (PDT) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.11.4/8.11.4) id f7DB02h75324; Mon, 13 Aug 2001 15:00:03 +0400 (MSD) (envelope-from ache) Date: Mon, 13 Aug 2001 14:59:59 +0400 From: "Andrey A. Chernov" To: Joseph Koshy Cc: arch@FreeBSD.ORG Subject: Re: CFR: fseek<0 + feof error (with fix) Message-ID: <20010813145956.A75227@nagual.pp.ru> References: <20010810232939.A14964@nagual.pp.ru> <20010813104030.55AE437B406@hub.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010813104030.55AE437B406@hub.freebsd.org> User-Agent: Mutt/1.3.20i Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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