From owner-freebsd-arch Mon Aug 13 6:13:29 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 3A10937B40F; Mon, 13 Aug 2001 06:13:24 -0700 (PDT) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.11.4/8.11.4) id f7DDDLR76937; Mon, 13 Aug 2001 17:13:22 +0400 (MSD) (envelope-from ache) Date: Mon, 13 Aug 2001 17:13:17 +0400 From: "Andrey A. Chernov" To: Joseph Koshy Cc: arch@FreeBSD.ORG Subject: Re: CFR: fseek<0 + feof error (with fix) Message-ID: <20010813171314.A76817@nagual.pp.ru> References: <20010813145956.A75227@nagual.pp.ru> <20010813112848.ABF4437B406@hub.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010813112848.ABF4437B406@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 04:28:48 -0700, Joseph Koshy wrote: > > Allowing negative file offsets for character special files is not actually > prohibited by the standards, IIRC, since this behaviour is termed > 'implementation dependent'. Perhaps someone with more standards expertise > than I have could clarify. Yet once, to make the difference more visible. What POSIX says about lseek(): [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. And now what about fseek{o}(): [EINVAL] The whence argument is invalid. The resulting file-position indicator would be set to a negative value. i.e. for all cases. BTW, for example I have OS/2 gcc result for test program I post and fseek() is POSIXed there, not so broken as ours. -- 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