fflush.3: fflush() discards buffered input

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2009-09-06 07:06:23 +02:00
parent 8749bd1a31
commit 2b64c171eb
1 changed files with 11 additions and 3 deletions

View File

@ -40,7 +40,7 @@
.\" Modified 2000-07-22 by Nicolás Lichtmaier <nick@debian.org>
.\" Modified 2001-10-16 by John Levon <moz@compsoc.man.ac.uk>
.\"
.TH FFLUSH 3 2009-02-23 "GNU" "Linux Programmer's Manual"
.TH FFLUSH 3 2009-09-06 "GNU" "Linux Programmer's Manual"
.SH NAME
fflush \- flush a stream
.SH SYNOPSIS
@ -48,11 +48,15 @@ fflush \- flush a stream
.sp
.BI "int fflush(FILE *" stream );
.SH DESCRIPTION
The function
For output streams,
.BR fflush ()
forces a write of all user-space buffered data for the given output or update
.I stream
via the stream's underlying write function.
For input streams,
.BR fflush ()
discards any buffered data that has been fetched from the underlying file,
but has not been by the application.
The open status of the stream is unaffected.
.PP
If the
@ -85,7 +89,11 @@ may also fail and set
for any of the errors specified for
.BR write (2).
.SH "CONFORMING TO"
C89, C99.
C89, C99, POSIX.1-2001, POSIX.1-2008.
The standards do not specify the behavior for input streams.
Most other implementations behave the same as Linux.
.\" Verified on: Solaris 8.
.SH NOTES
Note that
.BR fflush ()