Skip to main content

fdatasync

Function fdatasync 

Source
pub unsafe extern "system" fn fdatasync(fd: c_uint) -> c_int
Expand description

fdatasync() is similar to fsync(), but does not flush modified metadata unless that metadata is needed in order to allow a subsequent data retrieval to be correctly handled. For example, changes to st_atime or st_mtime (respectively, time of last access and time of last modification; see inode(7)) do not require flushing because they are not necessary for a subsequent data read to be handled correctly. On the other hand, a change to the file size (st_size, as made by say ftruncate(2)), would require a metadata flush.

§RETURN VALUE

On success, these system calls return zero. On error, -1 is returned, and errno is set to indicate the error.

Read the docs here