NAME | SYNOPSIS | FEATURES | DESCRIPTION | PARAMETERS | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO
#include <unistd.h>
int
fsync(int
fd);MSDOSFS, NFS_CLIENT, UFS
fsync() causes all modified data and attributes of fd to be moved to a permanent storage device. This usually results in all in-core modified copies of buffers for the associated file to be written to a disk.
fsync() should be used by programs that require a file to be in a known state, for example, in building a simple transaction facility.
On success, 0 is returned, if an error occurs, -1 is returned and an error code is written to the global location errno.
The fsync() call fails if:
EBADF
fd is not a valid file descriptor.
EINVAL
The fd argument refers to an object other than a file.
EIO
An I/O error occurred while reading from or writing to the file system.
ENOSYS
IOM is not configured.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | FEATURES | DESCRIPTION | PARAMETERS | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO