From owner-cvs-all Fri Aug 31 16:37:57 2001 Delivered-To: cvs-all@freebsd.org Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by hub.freebsd.org (Postfix) with ESMTP id 8201E37B405; Fri, 31 Aug 2001 16:37:46 -0700 (PDT) Received: (from ache@localhost) by nagual.pp.ru (8.11.6/8.11.6) id f7VNbWV24452; Sat, 1 Sep 2001 03:37:34 +0400 (MSD) (envelope-from ache) Date: Sat, 1 Sep 2001 03:37:27 +0400 From: "Andrey A. Chernov" To: Garrett Wollman Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/stdio ftell.c ungetc.c Message-ID: <20010901033723.B24264@nagual.pp.ru> References: <200108311950.f7VJoPd48683@freefall.freebsd.org> <20010901010738.B21988@nagual.pp.ru> <20010901024748.A23318@nagual.pp.ru> <200108312327.f7VNRMs83151@khavrinen.lcs.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200108312327.f7VNRMs83151@khavrinen.lcs.mit.edu> User-Agent: Mutt/1.3.21i Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Aug 31, 2001 at 19:27:22 -0400, Garrett Wollman wrote: > fseek() and ftell() are incorporated into POSIX from ISO C, and POSIX > defers to the C definition of these interfaces. But they are sometimes different from ISO C and POSIX notes so. > > It says "otherwise", i.e. ftell() can't return -1 normally, so we are in > > conflict. > > No, it does not say anything remotely like that. I was short and not explain whole picture. Maybe all "and" conditions there arranged in whole block, not -1 condition only, but in all such cases (when return code for error and normal cases is equal) POSIX recommend to test errno value and NOT return code. All apps I saw test ftell() return code and not errno value. Moreover, fseek(ftell()) is impossible if ftell() return something negative due to disabling negative offsets for fseek() per POSIX. All it means that ftell() can't return something negative in normal case. -- Andrey A. Chernov http://ache.pp.ru/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message