|
|
HP-UX Reference > Ffsync(2)HP-UX 11i Version 2: December 2007 Update |
|
NAMEfsync(), fdatasync() — synchronize a file's in-core and on-disk states DESCRIPTIONfsync() and fdatasync() cause all modified data and attributes of fildes to be moved to a permanent storage device. This normally results in all in-core modified copies of buffers for the associated file to be written to a disk. fsync() and fdatasync() apply to ordinary files, and apply to block special devices on systems which permit I/O to block special devices. fsync() and fdatasync() should be used by programs that require a file to be in a known state, such as when building a simple transaction facility. fdatasync() causes all modified data and file attributes of fildes required to retrieve the data to be written to disk. fsync() causes all modified data and all file attributes of fildes (including access time, modification time and status change time) to be written to disk. Together, fsync() and fdatasync() constitute support for File Synchronization. RETURN VALUEfsync() and fdatasync() return 0 on success or -1 if an error occurs, and set errno to indicate the error. |
|