Make fflush after ungetc work on BSD platforms.
[gnulib.git] / doc / posix-functions / fflush.texi
1 @node fflush
2 @section @code{fflush}
3 @findex fflush
4
5 POSIX specification: @url{http://www.opengroup.org/susv3xsh/fflush.html}
6
7 Gnulib module: fflush
8
9 Portability problems fixed by Gnulib:
10 @itemize
11 @item
12 @code{fflush} followed by @code{fseek} or @code{fseeko}, applied to an input
13 stream, should have the effect of positioning the underlying file descriptor.
14 It doesn't do this on some platforms.
15 @item
16 @code{fflush} on an input stream changes the position of the stream to the
17 end of the previous buffer, on some platforms: mingw.
18 @item
19 @code{fflush} on an input stream right after @code{ungetc} does not discard
20 the @code{ungetc} buffer, on some platforms:
21 MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, Cygwin.
22 Cygwin.
23 @end itemize
24
25 Portability problems not fixed by Gnulib:
26 @itemize
27 @item
28 @code{fflush}, @code{ftell}, @code{ftello}, @code{fgetpos} behave incorrectly
29 on input streams that are opened in @code{O_TEXT} mode and whose contents
30 contains Unix line terminators (LF), on some platforms: mingw.
31 @item
32 On Windows platforms (excluding Cygwin), this function does not set @code{errno}
33 upon failure.
34 @item
35 @code{fflush} on an input stream right after @code{ungetc} does not discard
36 the @code{ungetc} buffer, on some platforms:
37 AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw.
38 @end itemize