.\" Copyright (c) 1990 The Regents of the University of California.
.\" This code is derived from software contributed to Berkeley by
.\" %sccs.include.redist.man%
.\" @(#)fflush.3 5.1 (Berkeley) %G%
fflush, fpurge \- flush a stream
writes any buffered data for the given output
via the stream's underlying write function.
erases any input or output buffered in the given
For output streams this discards any unwritten output.
For input streams this discards any input read from the underlying object
this includes any text pushed back via
Upon successful completion 0 is returned.
is returned and the global variable
is set to indicate the error.
is not an open stream, or, in the case of
not a stream open for writing.
for any of the errors specified for the routine
write(2), fopen(3), fclose(3), setbuf(3)
conforms to ANSI X3.159-1989 (``ANSI C'').