]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) |
2 | .\" | |
1dd72f9c | 3 | .\" %%%LICENSE_START(GPLv2+_DOC_FULL) |
fea681da MK |
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 | |
c715f741 MK |
20 | .\" License along with this manual; if not, see |
21 | .\" <http://www.gnu.org/licenses/>. | |
6a8d8745 | 22 | .\" %%%LICENSE_END |
fea681da | 23 | .\" |
4b8c67d9 | 24 | .TH AIO_FSYNC 3 2017-09-15 "" "Linux Programmer's Manual" |
fea681da MK |
25 | .SH NAME |
26 | aio_fsync \- asynchronous file synchronization | |
27 | .SH SYNOPSIS | |
fea681da | 28 | .B "#include <aio.h>" |
68e4db0a | 29 | .PP |
fea681da | 30 | .BI "int aio_fsync(int " op ", struct aiocb *" aiocbp ); |
68e4db0a | 31 | .PP |
0ad25472 | 32 | Link with \fI\-lrt\fP. |
fea681da MK |
33 | .SH DESCRIPTION |
34 | The | |
e511ffb6 | 35 | .BR aio_fsync () |
fea681da MK |
36 | function does a sync on all outstanding asynchronous I/O operations |
37 | associated with | |
94e9d9fe | 38 | .IR aiocbp\->aio_fildes . |
2b014d76 MK |
39 | (See |
40 | .BR aio (7) | |
41 | for a description of the | |
42 | .I aiocb | |
43 | structure.) | |
dd3568a1 | 44 | .PP |
fea681da MK |
45 | More precisely, if |
46 | .I op | |
2f0af33b MK |
47 | is |
48 | .BR O_SYNC , | |
49 | then all currently queued I/O operations shall be | |
fea681da MK |
50 | completed as if by a call of |
51 | .BR fsync (2), | |
52 | and if | |
53 | .I op | |
2f0af33b MK |
54 | is |
55 | .BR O_DSYNC , | |
56 | this call is the asynchronous analog of | |
fea681da | 57 | .BR fdatasync (2). |
847e0d88 | 58 | .PP |
46e723d4 | 59 | Note that this is a request only; it does not wait for I/O completion. |
dd3568a1 | 60 | .PP |
fea681da | 61 | Apart from |
a534e8ba | 62 | .IR aio_fildes , |
fea681da MK |
63 | the only field in the structure pointed to by |
64 | .I aiocbp | |
65 | that is used by this call is the | |
66 | .I aio_sigevent | |
ec856419 MK |
67 | field (a |
68 | .I sigevent | |
69 | structure, described in | |
70 | .BR sigevent (7)), | |
71 | which indicates the desired type of asynchronous notification at completion. | |
fea681da | 72 | All other fields are ignored. |
47297adb | 73 | .SH RETURN VALUE |
fea681da | 74 | On success (the sync request was successfully queued) |
677f4766 | 75 | this function returns 0. |
dec985f9 | 76 | On error, \-1 is returned, and |
fea681da MK |
77 | .I errno |
78 | is set appropriately. | |
79 | .SH ERRORS | |
80 | .TP | |
81 | .B EAGAIN | |
82 | Out of resources. | |
83 | .TP | |
84 | .B EBADF | |
85 | .I aio_fildes | |
86 | is not a valid file descriptor open for writing. | |
87 | .TP | |
88 | .B EINVAL | |
5e91d9e1 | 89 | Synchronized I/O is not supported for this file, or |
fea681da | 90 | .I op |
2f0af33b MK |
91 | is not |
92 | .B O_SYNC | |
93 | or | |
94 | .BR O_DSYNC . | |
aea038d6 MK |
95 | .TP |
96 | .B ENOSYS | |
97 | .BR aio_fsync () | |
98 | is not implemented. | |
793514ae MK |
99 | .SH VERSIONS |
100 | The | |
101 | .BR aio_fsync () | |
102 | function is available since glibc 2.1. | |
35099f13 MS |
103 | .SH ATTRIBUTES |
104 | For an explanation of the terms used in this section, see | |
105 | .BR attributes (7). | |
106 | .TS | |
107 | allbox; | |
108 | lb lb lb | |
109 | l l l. | |
110 | Interface Attribute Value | |
111 | T{ | |
112 | .BR aio_fsync () | |
113 | T} Thread safety MT-Safe | |
114 | .TE | |
47297adb | 115 | .SH CONFORMING TO |
793514ae | 116 | POSIX.1-2001, POSIX.1-2008. |
47297adb | 117 | .SH SEE ALSO |
fea681da MK |
118 | .BR aio_cancel (3), |
119 | .BR aio_error (3), | |
120 | .BR aio_read (3), | |
121 | .BR aio_return (3), | |
122 | .BR aio_suspend (3), | |
ec856419 | 123 | .BR aio_write (3), |
cd587df6 | 124 | .BR lio_listio (3), |
25fa6c3d | 125 | .BR aio (7), |
ec856419 | 126 | .BR sigevent (7) |