MAN page from Old RedHat 5.X man-pages-1.19-1.noarch.rpm
FDATASYNC
Section: Linux Programmer's Manual (2)
Updated: 13 April 1996
Index NAME
fdatasync - synchronize a file's in-core data with that on disk
SYNOPSIS
#include <unistd.h>#ifdef _POSIX_SYNCHRONIZED_IO
int fdatasync(int fd);
#endif
DESCRIPTION
fdatasyncflushes all data buffers of a file to disk (before the systemcall returns). It resembles
fsyncbut is not required to update the metadata such as access time.
Applications that access databases or log files often write a tinydata fragment (e.g., one line in a log file) and then callfsyncimmediately in order to ensure that the written data is physicallystored on the harddisk. Unfortunately,fsyncwill always initiate two write operations: one for the newly writtendata and another one in order to update the modification time storedin the inode. If the modification time is not a part of the transactionconceptfdatasynccan be used to avoid unnecessary inode disk write operations.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and
errnois set appropriately.
ERRORS
- EBADF
- fdis not a valid file descriptor open for writing.
- EROFS, EINVAL
- fdis bound to a special file which does not support synchronization.
- EIO
- An error occurred during synchronization.
BUGS
Currently (Linux 2.0.23)
fdatasyncis equivalent to
fsync.
CONFORMING TO
POSIX1b (formerly POSIX.4)
SEE ALSO
fsync(2),B.O. Gallmeister, POSIX.4, O'Reilly, pp. 220-223 and 343.
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- RETURN VALUE
- ERRORS
- BUGS
- CONFORMING TO
- SEE ALSO
This document was created byman2html,using the manual pages.