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 the global variable
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
only flushes 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