Date: Wed, 28 Jan 2009 06:28:53 -0500 From: Tom Rhodes <trhodes@FreeBSD.org> To: Bruce Evans <brde@optusnet.com.au> Cc: svn-src-head@FreeBSD.org, rdivacky@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r187805 - head/lib/libc/stdio Message-ID: <20090128062853.06ee8c95.trhodes@FreeBSD.org> In-Reply-To: <20090128212904.E45316@delplex.bde.org> References: <200901280111.n0S1BL7n003092@svn.freebsd.org> <20090128081914.GA22309@freebsd.org> <20090128212904.E45316@delplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 28 Jan 2009 22:15:22 +1100 (EST) Bruce Evans <brde@optusnet.com.au> wrote: > 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 > Exactly, listing every possible method is a bit much I think. Anyway, I picked off the last mention of it, which I missed earlier. Thanks! -- Tom Rhodes
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090128062853.06ee8c95.trhodes>