The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

fdatasync - synchronise the data of a file (REALTIME)

 SYNOPSIS



#include <unistd.h>

int fdatasync(int fildes);

 DESCRIPTION

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 fsync() (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.

 RETURN VALUE

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.

 ERRORS

The fdatasync() function will fail if:
[EBADF]
The fildes argument is not a valid file descriptor open for writing.
[EINVAL]
This implementation does not support synchronised I/O for this file.
[ENOSYS]
The function fdatasync() is not supported by this implementation.

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

 EXAMPLES

None.

 APPLICATION USAGE

None.

 FUTURE DIRECTIONS

None.

 SEE ALSO

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

DERIVATION

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

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]