FSYNC(2) SysV FSYNC(2)
NAME
fsync - Writes changes in a file to permanent storage
SYNOPSIS
int fsync (filedes )
int filedes;
DESCRIPTION
The fsync function saves all modified data in the file open on the
filedes argument to permanent storage. filedes Specifies a valid open
file descriptor.
On return from the fsync function, all updates have been saved on
permanent storage.
DIAGNOSTICS
Upon successful completion, the fsync function returns a value of 0
(zero). If fsync fails, a value of -1 is returned and errno is set to
indicate the error.
ERRORS
fsync function fails if:
[EIO] An I/O error occurred while reading from or writing to the file
system.
[EBADF] The filedes argument is not a valid file descriptor open for
writing.
[EINVAL] The filedes argument does not refer to a file on which this
operation is possible.
[EINTR] The fsync function was interrupted by a signal which was
caught.
SEE ALSO
open(2), sync(2), write(2)