fsync()

synchronize file changes 

Function


SYNOPSIS

#include <unistd.h>

int fsync(int fildes);


DESCRIPTION

The fsync() function synchronizes a file's in-memory state with that on the physical medium.

The fsync() function should be used by programs which require modifications to a file to be completed before continuing, such as with database transactions.


PARAMETERS

fildes 

Is the file descriptor for the file to be synchronized.


RETURN VALUES

Upon successful completion, fsync() returns 0. On failure, it returns -1 and errno is set to one of the following values:

EBADF 

fildes is not a file descriptor that is open for writing.

EINVAL 

The fildes argument refers to a file for which this operation is not possible.


CONFORMANCE

UNIX 98.


MULTITHREAD SAFETY LEVEL

Async-signal-safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
close(), dup(), fcntl(), open(), pipe(), write()


PTC MKS Toolkit 10.5 Documentation Build 40.