This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fopen + mmap


Roland McGrath <roland@frob.com> writes:

|> 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.

Neither C99 nor POSIX.1-2001 defines fflush on input streams, or on update
streams where the last operation was input.  SUS2 doesn't either.  In the
rational of POSIX.1-2001 it says:

    Data buffered by the system may make determining the validity of the
    position of the current file descriptor impractical. Thus, enforcing
    the repositioning of the file descriptor after fflush() on streams
    open for read() is not mandated by IEEE Std 1003.1-2001.


Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]