For output streams,
forces a write of all user-space buffered data for the given output or update
via the stream's underlying write function.
For input streams,
discards any buffered data that has been fetched from the underlying file,
but has not been by the application.
The open status of the stream is unaffected.
argument is NULL,
open output streams.
Upon successful completion 0 is returned.
is returned and
is set to indicate the error.
is not an open stream, or is not open for writing.
may also fail and set
for any of the errors specified for
C89, C99, POSIX.1-2001, POSIX.1-2008.
The standards do not specify the behavior for input streams.
Most other implementations behave the same as Linux.
only flushes the user space buffers provided by the C library.
To ensure that the data is physically stored on disk
the kernel buffers must be flushed too, for example, with