fsync(2)
_________________________________________________________________
fsync System Call
Synchronize a file's in-core state with that on disk.
_________________________________________________________________
SYNTAX
int fsync (fildes)
int fildes;
PARAMETERS
fildes File descriptor.
DESCRIPTION
<Fildes> is a valid, active file descriptor that refers to an
open file. Fsync 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:
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
fsync(2)
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
The related manual sections: sync(2),
sync(1).
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)