Query: fdatasync
OS: redhat
Section: 2
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
FDATASYNC(2) Linux Programmer's Manual FDATASYNC(2)NAMEfdatasync - synchronize a file's in-core data with that on diskSYNOPSIS#include <unistd.h> #ifdef _POSIX_SYNCHRONIZED_IO int fdatasync(int fd); #endifDESCRIPTIONfdatasync flushes all data buffers of a file to disk (before the system call returns). It resembles fsync 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 fsync immedi- ately in order to ensure that the written data is physically stored on the harddisk. Unfortunately, fsync 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 modifica- tion time is not a part of the transaction concept fdatasync can be used to avoid unnecessary inode disk write operations.RETURN VALUEOn success, zero is returned. On error, -1 is returned, and errno is set appropriately.ERRORSEBADF fd is not a valid file descriptor open for writing. EROFS, EINVAL fd is bound to a special file which does not support synchronization. EIO An error occurred during synchronization.BUGSCurrently (Linux 2.2) fdatasync is equivalent to fsync.CONFORMING TOPOSIX1b (formerly POSIX.4)SEE ALSOfsync(2), B.O. Gallmeister, POSIX.4, O'Reilly, pp. 220-223 and 343. Linux 1.3.86 1996-04-13 FDATASYNC(2)
Related Man Pages |
---|
fdatasync(3p) - centos |
fdatasync(2) - linux |
fdatasync(2) - centos |
fsync(2) - centos |
fdatasync(2) - suse |
Similar Topics in the Unix Linux Community |
---|
file access inode update |
Inode number changes for a file in Redhat Linux |