FSYNC(2) — HP-UX
NAME
fsync − synchronize a file’s in-core state with its state on disk
SYNOPSIS
int fsync(fildes)
int fildes;
DESCRIPTION
Fsync causes 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 applies to ordinary files, and applies to block special devices on systems which permit I/O to block special devices.
Fsync should be used by programs which require a file to be in a known state; for example in building a simple transaction facility.
ERRORS
Fsync will fail if one of the following conditions is true and errno will be set accordingly:
[EBADF] Fildes is not a valid descriptor.
[EINVAL] Fildes refers to a file type to which fsync does not apply.
RETURN VALUE
A 0 value is returned on success. A −1 value indicates an error.
BUGS
The current implementation of this call is expensive for large files.
AUTHOR
Fsync was developed by the Hewlett-Packard Company, and the University of California, Berkeley California, Computer Science Division, Department of Electrical Engineering and Computer Science.
SEE ALSO
fcntl(2), fcntl(5), open(2), select(2), sync(2), sync(1M).
Hewlett-Packard Company — Version B.1, May 11, 2021