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

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       fdatasync — synchronize the data of a file (REALTIME)
13

SYNOPSIS

15       #include <unistd.h>
16
17       int fdatasync(int fildes);
18

DESCRIPTION

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

RETURN VALUE

30       If  successful, the fdatasync() function shall return the value 0; oth‐
31       erwise, the function shall return the value -1 and set errno  to  indi‐
32       cate  the  error.  If  the  fdatasync() function fails, outstanding I/O
33       operations are not guaranteed to have been completed.
34

ERRORS

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

EXAMPLES

49       None.
50

APPLICATION USAGE

52       Note that even if the file descriptor is not open for writing, if there
53       are  any  pending  write requests on the underlying file, then that I/O
54       will be completed prior to the return of fdatasync().
55

RATIONALE

57       None.
58

FUTURE DIRECTIONS

60       None.
61

SEE ALSO

63       aio_fsync(), fcntl(), fsync(), open(), read(), write()
64
65       The Base Definitions volume of POSIX.1‐2017, <unistd.h>
66
68       Portions of this text are reprinted and reproduced in  electronic  form
69       from  IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
70       table Operating System Interface (POSIX), The Open Group Base  Specifi‐
71       cations  Issue  7, 2018 Edition, Copyright (C) 2018 by the Institute of
72       Electrical and Electronics Engineers, Inc and The Open Group.   In  the
73       event of any discrepancy between this version and the original IEEE and
74       The Open Group Standard, the original IEEE and The Open Group  Standard
75       is  the  referee document. The original Standard can be obtained online
76       at http://www.opengroup.org/unix/online.html .
77
78       Any typographical or formatting errors that appear  in  this  page  are
79       most likely to have been introduced during the conversion of the source
80       files to man page format. To report such errors,  see  https://www.ker
81       nel.org/doc/man-pages/reporting_bugs.html .
82
83
84
85IEEE/The Open Group                  2017                        FDATASYNC(3P)
Impressum