fdatasync

Synchronizes the data to a file.

Library:LibC
Classification:POSIX
Service:File and Directory I/O

Syntax

  #include <unistd.h> 
   
  int fdatasync (
     int   fildes);
  

Parameters

fildes

(IN) Specifies a file descriptor.

Return Values

If successful, returns 0. Otherwise, returns -1 and sets errno to one of the following:

Decimal

Constant

Description

4

EBADF

Invalid file descriptor.

9

ENIVAL

I/O synchronization is not supported for this file.

Remarks

The fdatasync function forces all currently queued I/O operations associated with the specified file to the synchronized completion state.

See Also