[Previous] [Contents] [Index] [Next]

Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

fdatasync()

Synchronize file data

Synopsis:

#include <unistd.h>

int fdatasync( int filedes );

Arguments:

filedes
The descriptor of the file that you want to synchronize.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The fdatasync() function forces all queued I/O operations for the file specified by the filedes file descriptor to finish, synchronizing the file's data.

This function is similar to fsync(), except that fsync() also guarantees the integrity of file information, such as access and modification times.

Returns:

0
Success.
-1
An error occurred (errno is set).

Errors:

EBADF
The specified filedes isn't a valid file descriptor open for writing.
EINVAL
The implementation doesn't support synchronized I/O for the given file.
ENOSYS
The fdatasync() function isn't supported for the filesystem specified by filedes.

Classification:

POSIX 1003.1 SIO

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

aio_fsync(), close(), fcntl(), fsync(), open(), read(), sync(), write()


[Previous] [Contents] [Index] [Next]