FDATASYNC(3) Library Functions Manual FDATASYNC(3)

fdatasyncsynchronise the data of a file (REALTIME)

#include <unistd.h>

int fdatasync(int fildes);

The fdatasync() function forces all currently queued I/O operations associated with the file indicated by file descriptor fildes to the synchronised I/O completion state.

The functionality is as described for (with the symbol _XOPEN_REALTIME defined), with the exception that all I/O operations are completed as defined for synchronised I/O data integrity completion.

If successful, the fdatasync() function returns the value 0. Otherwise, the function returns the value -1 and sets errno to indicate the error. If the fdatasync() function fails, outstanding I/O operations are not guaranteed to have been completed.

The fdatasync() function will fail if:

The fildes argument is not a valid file descriptor open for writing.
This implementation does not support synchronised I/O for this file.
The function fdatasync() is not supported by this implementation.

In the event that any of the queued I/O operations fail, returns the error conditions defined for and .

None.

None.

None.

aio_fsync(3) , fcntl(3) , fsync(3) , open(3) , read(3) , write(3) .

Derived from the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995)

February 1997 posix.fail