Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Apr 2009 16:56:29 +0200
From:      Jilles Tjoelker <jilles@stack.nl>
To:        bug-followup@FreeBSD.org, twschulz@trolltech.com, freebsd-standards@freebsd.org
Subject:   Re: bin/108118: [libc] files should not cache their EOF status
Message-ID:  <20090404145629.GA31339@stack.nl>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090404145629.GA31339>