The function fflush forces a write of all user-space buffered data for
the given output or update stream via the stream's underlying write
function. The open status of the stream is unaffected.
If the stream argument is NULL, fflush flushes all
open output streams.
For a non-locking counterpart, see unlocked_stdio(3).
Note that fflush() 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, e.g. with sync(2) or fsync(2).