fopen + mmap

Roland McGrath roland@frob.com
Sat Jan 19 13:22:00 GMT 2002


> Roland McGrath <roland@frob.com> writes:
> 
> > I don't follow your reading of the standards here.  After fopen, the new
> > stream's file position indicator is at the beginning of the file.
> 
> Read carefully then.  fflush is not defined on input streams.

If you ever wanted to make one of these discussions go faster and be less
aggravating to all parties, you could include some details with your claims.
I guess HJ's style has been an inspiration to you, because you've found it
so helpful and efficient over the years.

I don't have ANSI C on hand, but my recollection is pretty clear that
fflush is specifically defined for input streams (to discard buffered
input).  POSIX.1-1996 section 8.2.3 (p 213 in the ISO printing)
specifically mentions using fflush on input streams to synchronize the file
position.



More information about the Libc-hacker mailing list