int sync(void);
The syscall flushes the associated caches of all FSes and the devices that contain said FSs, ensuring that all operations are finished, this can be used in order to ensure data coherency on power loss or program failure.
The syscall returns 0
or -1
on failure, with a corresponding
errno:
EIO
: Device error while flushing.