.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" This code is derived from software contributed to Berkeley by
.\" Chris Torek and the American National Standards Committee X3,
.\" on Information Processing Systems.
.\" %sccs.include.redist.man%
.\" @(#)fflush.3 5.4 (Berkeley) %G%
.Fn fflush "FILE *stream"
.Fn fpurge "FILE *stream"
forces a write of all buffered data for the given output or update
via the stream's underlying write function.
The open status of the stream is unaffected.
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