function flushes the stream pointed to by
(writing any buffered output data using
and closes the underlying file descriptor.
The behaviour of
is undefined if the
parameter is an illegal pointer, or is a descriptor already passed
to a previous invocation of
Upon successful completion 0 is returned.
is returned and
is set to indicate the error.
In either case any further access
(including another call to
to the stream results in undefined behavior.
The file descriptor underlying
is not valid.
function may also fail and set
for any of the errors specified for the routines
For an explanation of the terms used in this section, see
POSIX.1-2001, POSIX.1-2008, C89, C99.
flushes only the user-space buffers provided by the
To ensure that the data is physically stored
on disk the kernel buffers must be flushed too, for example, with
This page is part of release 4.04 of the Linux
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at