- 论坛徽章:
- 4
|
- POSIX provides for three different variants of synchronized I/O, corresponding to the flags O_SYNC, O_DSYNC, and O_RSYNC. Currently (2.6.31),
- Linux only implements O_SYNC, but glibc maps O_DSYNC and O_RSYNC to the same numerical value as O_SYNC. Most Linux file systems don’t actually
- implement the POSIX O_SYNC semantics, which require all metadata updates of a write to be on disk on returning to userspace, but only the
- O_DSYNC semantics, which require only actual file data and metadata necessary to retrieve it to be on disk by the time the system call returns.
复制代码- Calling fsync() does not necessarily ensure that the entry in the directory containing the file has also reached disk. For that an explicit
- fsync() on a file descriptor for the directory is also needed.
复制代码 |
|