OSDN Git Service

afed3ce180f475e7616173fe6ec57d37a5f75d89
[linuxjm/LDP_man-pages.git] / original / man3 / aio_fsync.3
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 2012-05-08  "" "Linux Programmer's Manual"
25 .SH NAME
26 aio_fsync \- asynchronous file synchronization
27 .SH SYNOPSIS
28 .B "#include <aio.h>"
29 .sp
30 .BI "int aio_fsync(int " op ", struct aiocb *" aiocbp );
31 .sp
32 Link with \fI\-lrt\fP.
33 .SH DESCRIPTION
34 The
35 .BR aio_fsync ()
36 function does a sync on all outstanding asynchronous I/O operations
37 associated with
38 .IR aiocbp\->aio_fildes .
39 (See
40 .BR aio (7)
41 for a description of the
42 .I aiocb
43 structure.)
44 .LP
45 More precisely, if
46 .I op
47 is
48 .BR O_SYNC ,
49 then all currently queued I/O operations shall be
50 completed as if by a call of
51 .BR fsync (2),
52 and if
53 .I op
54 is
55 .BR O_DSYNC ,
56 this call is the asynchronous analog of
57 .BR fdatasync (2).
58
59 Note that this is a request only; it does not wait for I/O completion.
60 .LP
61 Apart from
62 .IR aio_fildes ,
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
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.
72 All other fields are ignored.
73 .SH RETURN VALUE
74 On success (the sync request was successfully queued)
75 this function returns 0.
76 On error, \-1 is returned, and
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
89 Synchronized I/O is not supported for this file, or
90 .I op
91 is not
92 .B O_SYNC
93 or
94 .BR O_DSYNC .
95 .TP
96 .B ENOSYS
97 .BR aio_fsync ()
98 is not implemented.
99 .SH VERSIONS
100 The
101 .BR aio_fsync ()
102 function is available since glibc 2.1.
103 .SH CONFORMING TO
104 POSIX.1-2001, POSIX.1-2008.
105 .SH SEE ALSO
106 .BR aio_cancel (3),
107 .BR aio_error (3),
108 .BR aio_read (3),
109 .BR aio_return (3),
110 .BR aio_suspend (3),
111 .BR aio_write (3),
112 .BR lio_listio (3),
113 .BR aio (7),
114 .BR sigevent (7)
115 .SH COLOPHON
116 This page is part of release 3.67 of the Linux
117 .I man-pages
118 project.
119 A description of the project,
120 information about reporting bugs,
121 and the latest version of this page,
122 can be found at
123 \%http://www.kernel.org/doc/man\-pages/.