This document was created by man2html using the manual pages.
Section: Linux Programmer's Manual (2)
Return to NetAdminTools
fdatasync - synchronize a file's in-core data with that on disk
int fdatasync(int fd);
flushes all data buffers of a file to disk (before the system
call returns). It resembles
but is not required to update the metadata such as access time.
Applications that access databases or log files often write a tiny
data fragment (e.g., one line in a log file) and then call
immediately in order to ensure that the written data is physically
stored on the harddisk. Unfortunately,
will always initiate two write operations: one for the newly written
data and another one in order to update the modification time stored
in the inode. If the modification time is not a part of the transaction
can be used to avoid unnecessary inode disk write operations.
On success, zero is returned. On error, -1 is returned, and
is set appropriately.
is not a valid file descriptor open for writing.
- EROFS, EINVAL
is bound to a special file which does not support synchronization.
An error occurred during synchronization.
Currently (Linux 2.2)
is equivalent to
POSIX1b (formerly POSIX.4)
B.O. Gallmeister, POSIX.4, O'Reilly, pp. 220-223 and 343.
- RETURN VALUE
- CONFORMING TO
- SEE ALSO
Return to NetAdminTools,