[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bin/108118: [libc] files should not cache their EOF status

The following reply was made to PR bin/108118; it has been noted by GNATS.

From: Jilles Tjoelker <jilles_(_at_)_stack_(_dot_)_nl>
To: bug-followup_(_at_)_FreeBSD_(_dot_)_org, twschulz_(_at_)_trolltech_(_dot_)_com,
Subject: Re: bin/108118: [libc] files should not cache their EOF status
Date: Sat, 4 Apr 2009 16:56:29 +0200

 The way I read POSIX, FreeBSD's current behaviour seems correct. Calling
 fread(3) is equivalent to calling fgetc(3) an appropriate number of
 times, and fgetc(3) shall fail if the end-of-file indicator is set for
 the stream, even if data is available on the underlying file.
 Apparently, POSIX aligns with the C standard here; System V tradition is
 not to check the end-of-file indicator here. Both
 src/lib/libc/stdio/refill.c (__srefill()) and Solaris fgetc(3) manpage
 agree about this.
 Jilles Tjoelker
freebsd-bugs_(_at_)_freebsd_(_dot_)_org mailing list
To unsubscribe, send any mail to "freebsd-bugs-unsubscribe_(_at_)_freebsd_(_dot_)_org"