FFLUSH
Section: C Library Functions (3)
Index
Return to Main Contents
BSD mandoc
NAME
fflush
fpurge
- flush a stream
SYNOPSIS
Fd #include <stdio.h>
Ft int
Fn fflush FILE *stream
Ft int
Fn fpurge FILE *stream
DESCRIPTION
The function
Fn fflush
forces a write of all buffered data for the given output or update
Fa stream
via the stream's underlying write function.
The open status of the stream is unaffected.
If the
Fa stream
argument is
NULL
Fn fflush
flushes
all
open output streams.
The function
Fn fpurge
erases any input or output buffered in the given
Fa stream .
For output streams this discards any unwritten output.
For input streams this discards any input read from the underlying object
but not yet obtained via
getc(3);
this includes any text pushed back via
ungetc.
RETURN VALUES
Upon successful completion 0 is returned.
Otherwise,
EOF
is returned and the global variable
errno
is set to indicate the error.
ERRORS
- Bq Er EBADF
-
Fa Stream
is not an open stream, or, in the case of
Fn fflush ,
not a stream open for writing.
The function
Fn fflush
may also fail and set
errno
for any of the errors specified for the routine
write(2).
SEE ALSO
write(2),
fopen(3),
fclose(3),
setbuf(3)
STANDARDS
The
Fn fflush
function
conforms to
St -ansiC .
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- RETURN VALUES
-
- ERRORS
-
- SEE ALSO
-
- STANDARDS
-
This document was created by
man2html,
using the manual pages.
Time: 15:52:52 GMT, January 15, 2023