pub unsafe extern "system" fn fsync(fd: c_uint) -> c_intExpand description
fsync() transfers (“flushes”) all modified in-core data of (i.e., modified buffer cache pages for) the file referred to by the file descriptor fd to the disk device (or other permanent storage device) so that all changed information can be retrieved even if the system crashes or is rebooted. This includes writing through or flushing a disk cache if present. The call blocks until the device reports that the transfer has completed.
§RETURN VALUE
On success, these system calls return zero. On error, -1 is returned, and errno is set to indicate the error.
§Link
Read the docs here