1FDATASYNC(P)               POSIX Programmer's Manual              FDATASYNC(P)
2
3
4

NAME

6       fdatasync - synchronize the data of a file (REALTIME)
7

SYNOPSIS

9       #include <unistd.h>
10
11       int fdatasync(int fildes);
12
13

DESCRIPTION

15       The  fdatasync()  function  shall force all currently queued I/O opera‐
16       tions associated with the file indicated by file descriptor  fildes  to
17       the synchronized I/O completion state.
18
19       The  functionality  shall  be  equivalent  to  fsync()  with the symbol
20       _POSIX_SYNCHRONIZED_IO defined, with the exception that all I/O  opera‐
21       tions shall be completed as defined for synchronized I/O data integrity
22       completion.
23

RETURN VALUE

25       If successful, the fdatasync() function shall return the value 0;  oth‐
26       erwise,  the  function shall return the value -1 and set errno to indi‐
27       cate the error. If the  fdatasync()  function  fails,  outstanding  I/O
28       operations are not guaranteed to have been completed.
29

ERRORS

31       The fdatasync() function shall fail if:
32
33       EBADF  The  fildes  argument  is  not  a valid file descriptor open for
34              writing.
35
36       EINVAL This implementation does not support synchronized I/O  for  this
37              file.
38
39
40       In  the  event  that any of the queued I/O operations fail, fdatasync()
41       shall return the error conditions defined for read() and write().
42
43       The following sections are informative.
44

EXAMPLES

46       None.
47

APPLICATION USAGE

49       None.
50

RATIONALE

52       None.
53

FUTURE DIRECTIONS

55       None.
56

SEE ALSO

58       aio_fsync() , fcntl() , fsync() , open() , read() , write() , the  Base
59       Definitions volume of IEEE Std 1003.1-2001, <unistd.h>
60
62       Portions  of  this text are reprinted and reproduced in electronic form
63       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
64       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
65       Specifications Issue 6, Copyright (C) 2001-2003  by  the  Institute  of
66       Electrical  and  Electronics  Engineers, Inc and The Open Group. In the
67       event of any discrepancy between this version and the original IEEE and
68       The  Open Group Standard, the original IEEE and The Open Group Standard
69       is the referee document. The original Standard can be  obtained  online
70       at http://www.opengroup.org/unix/online.html .
71
72
73
74IEEE/The Open Group                  2003                         FDATASYNC(P)
Impressum