Changes.old: Add missing entry in 5.13 changelog
[man-pages.git] / man3 / aio_fsync.3
blob27be9cfd78a4e224e37c0e703fc5f2f393abeb94
1 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
8 .\"
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
13 .\"
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 .\" GNU General Public License for more details.
18 .\"
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, see
21 .\" <http://www.gnu.org/licenses/>.
22 .\" %%%LICENSE_END
23 .\"
24 .TH AIO_FSYNC 3 2021-03-22  "" "Linux Programmer's Manual"
25 .SH NAME
26 aio_fsync \- asynchronous file synchronization
27 .SH SYNOPSIS
28 .nf
29 .B "#include <aio.h>"
30 .PP
31 .BI "int aio_fsync(int " op ", struct aiocb *" aiocbp );
32 .PP
33 Link with \fI\-lrt\fP.
34 .fi
35 .SH DESCRIPTION
36 The
37 .BR aio_fsync ()
38 function does a sync on all outstanding asynchronous I/O operations
39 associated with
40 .IR aiocbp\->aio_fildes .
41 (See
42 .BR aio (7)
43 for a description of the
44 .I aiocb
45 structure.)
46 .PP
47 More precisely, if
48 .I op
50 .BR O_SYNC ,
51 then all currently queued I/O operations shall be
52 completed as if by a call of
53 .BR fsync (2),
54 and if
55 .I op
57 .BR O_DSYNC ,
58 this call is the asynchronous analog of
59 .BR fdatasync (2).
60 .PP
61 Note that this is a request only; it does not wait for I/O completion.
62 .PP
63 Apart from
64 .IR aio_fildes ,
65 the only field in the structure pointed to by
66 .I aiocbp
67 that is used by this call is the
68 .I aio_sigevent
69 field (a
70 .I sigevent
71 structure, described in
72 .BR sigevent (7)),
73 which indicates the desired type of asynchronous notification at completion.
74 All other fields are ignored.
75 .SH RETURN VALUE
76 On success (the sync request was successfully queued)
77 this function returns 0.
78 On error, \-1 is returned, and
79 .I errno
80 is set to indicate the error.
81 .SH ERRORS
82 .TP
83 .B EAGAIN
84 Out of resources.
85 .TP
86 .B EBADF
87 .I aio_fildes
88 is not a valid file descriptor open for writing.
89 .TP
90 .B EINVAL
91 Synchronized I/O is not supported for this file, or
92 .I op
93 is not
94 .B O_SYNC
96 .BR O_DSYNC .
97 .TP
98 .B ENOSYS
99 .BR aio_fsync ()
100 is not implemented.
101 .SH VERSIONS
103 .BR aio_fsync ()
104 function is available since glibc 2.1.
105 .SH ATTRIBUTES
106 For an explanation of the terms used in this section, see
107 .BR attributes (7).
108 .ad l
111 allbox;
112 lbx lb lb
113 l l l.
114 Interface       Attribute       Value
116 .BR aio_fsync ()
117 T}      Thread safety   MT-Safe
121 .sp 1
122 .SH CONFORMING TO
123 POSIX.1-2001, POSIX.1-2008.
124 .SH SEE ALSO
125 .BR aio_cancel (3),
126 .BR aio_error (3),
127 .BR aio_read (3),
128 .BR aio_return (3),
129 .BR aio_suspend (3),
130 .BR aio_write (3),
131 .BR lio_listio (3),
132 .BR aio (7),
133 .BR sigevent (7)