OSDN Git Service

(split) LDP man-pages の original/ を v3.29 に更新。
[linuxjm/LDP_man-pages.git] / original / man3 / aio_fsync.3
1 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
12 .\"
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 .\" GNU General Public License for more details.
17 .\"
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
21 .\" USA.
22 .\"
23 .TH AIO_FSYNC 3 2010-10-02  "" "Linux Programmer's Manual"
24 .SH NAME
25 aio_fsync \- asynchronous file synchronization
26 .SH SYNOPSIS
27 .B "#include <aio.h>"
28 .sp
29 .BI "int aio_fsync(int " op ", struct aiocb *" aiocbp );
30 .sp
31 Link with \fI\-lrt\fP.
32 .SH DESCRIPTION
33 The
34 .BR aio_fsync ()
35 function does a sync on all outstanding asynchronous I/O operations
36 associated with
37 .IR aiocbp\->aio_fildes .
38 (See
39 .BR aio (7)
40 for a description of the
41 .I aiocb
42 structure.)
43 .LP
44 More precisely, if
45 .I op
46 is
47 .BR O_SYNC ,
48 then all currently queued I/O operations shall be
49 completed as if by a call of
50 .BR fsync (2),
51 and if
52 .I op
53 is
54 .BR O_DSYNC ,
55 this call is the asynchronous analog of
56 .BR fdatasync (2).
57
58 Note that this is a request only; it does not wait for I/O completion.
59 .LP
60 Apart from
61 .IR aio_fildes ,
62 the only field in the structure pointed to by
63 .I aiocbp
64 that is used by this call is the
65 .I aio_sigevent
66 field (a
67 .I sigevent
68 structure, described in
69 .BR sigevent (7)),
70 which indicates the desired type of asynchronous notification at completion.
71 All other fields are ignored.
72 .SH "RETURN VALUE"
73 On success (the sync request was successfully queued)
74 this function returns 0.
75 On error \-1 is returned, and
76 .I errno
77 is set appropriately.
78 .SH ERRORS
79 .TP
80 .B EAGAIN
81 Out of resources.
82 .TP
83 .B EBADF
84 .I aio_fildes
85 is not a valid file descriptor open for writing.
86 .TP
87 .B EINVAL
88 Synchronized I/O is not supported for this file, or
89 .I op
90 is not
91 .B O_SYNC
92 or
93 .BR O_DSYNC .
94 .SH VERSIONS
95 The
96 .BR aio_fsync ()
97 function is available since glibc 2.1.
98 .SH "CONFORMING TO"
99 POSIX.1-2001, POSIX.1-2008.
100 .SH "SEE ALSO"
101 .BR aio_cancel (3),
102 .BR aio_error (3),
103 .BR aio_read (3),
104 .BR aio_return (3),
105 .BR aio_suspend (3),
106 .BR aio_write (3),
107 .BR lio_listio (3),
108 .BR aio (7),
109 .BR sigevent (7)