From owner-svn-src-head@FreeBSD.ORG Wed Jan 28 11:15:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8EA01065670; Wed, 28 Jan 2009 11:15:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 806448FC21; Wed, 28 Jan 2009 11:15:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-107-120-227.carlnfd1.nsw.optusnet.com.au (c122-107-120-227.carlnfd1.nsw.optusnet.com.au [122.107.120.227]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n0SBFMZm005050 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 28 Jan 2009 22:15:24 +1100 Date: Wed, 28 Jan 2009 22:15:22 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Roman Divacky In-Reply-To: <20090128081914.GA22309@freebsd.org> Message-ID: <20090128212904.E45316@delplex.bde.org> References: <200901280111.n0S1BL7n003092@svn.freebsd.org> <20090128081914.GA22309@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Tom Rhodes , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187805 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2009 11:15:33 -0000 On Wed, 28 Jan 2009, Roman Divacky wrote: > On Wed, Jan 28, 2009 at 01:11:21AM +0000, Tom Rhodes wrote: >> Log: >> Remove comment about clearerr() being the only method of clearing >> the EOF indicator, fseek() may also be used for this. fseek() can't always be used for this, since fseek() fails for unseekable files (even SEEK_CUR fails then). However, when it works, it has the advantage(?) of not clobbering the error indicator. The comment was also wrong because the EOF indicator can also be cleared by clearerr_unlocked() in some cases and by fseeko() in the same cases as by fseek(). > why not saying what you state in the commit message in the man page > instead of removing the info entirely? Well, neither C99 nor POSIX say this for feof(). The man page still says that the error indicator can only be cleared by clearerr(). This is false since a sucessful rewind() clears both indicators, and the indicator can be cleared by clearerr_unlocked() in some cases. I think the man page is trying to make the false claims that the indicators are not cleared as side effects and is not trying to list all the functions that do clear the indicators as side effects, and that it shouldn't try to do the latter. The list for the EOF indicator may be quite long and system-and-time-dependent since it includes the closure of all functions that call fseek(), or fseeko()). For both indicators, the list includes the closure of all functions that call clearerr() or clearerr_unlocked(). Perhaps no such functions in standard libraries are permitted to operate on application streams, but this is unclear. Bruce