fsync(2) DG/UX 4.30 fsync(2)
NAME
fsync - Synchronize a file's in-core state with that on
disk.
SYNOPSIS
int fsync (fildes)
int fildes;
PARAMETERS
fildes A valid, active file descriptor that refers
to an open file.
DESCRIPTION
The fsync system call causes all modified data and
attributes of the file to be written to disk. Write
operations performed by the write or writev system calls are
atomic, so it is not possible for fsync to record the
results of a partial write. Also, while the fsync is being
performed, further writes to the file are blocked. Thus,
fsync ensures that a snapshot of the file's state is on
physical disk.
Upon successful completion of all writes, the file's time of
last file attribute change (st_ctime) is set to the current
time.
ACCESS CONTROL
None.
RETURN VALUE
0 The synchronization was successful.
-1 An error occurred. Errno is set to indicate
the error.
EXCEPTIONS
Errno may be set to one of the following error codes:
EBADF Fildes is not a valid descriptor.
EINVAL Fildes refers to an object other than a file.
EIO An I/O error occurred while reading from or
writing to the file system.
SEE ALSO
sync(2),
sync(1M).
Licensed material--property of copyright holder(s) Page 1