teach manpages about largefile's demise
[unleashed.git] / share / man / man3c / aio_fsync.3c
blob942b3bbde8d8ccdd4436f97cabea6fb601cd0e49
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright 1989 AT&T
44 .\" Portions Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
45 .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved.
46 .\"
47 .TH AIO_FSYNC 3C "Feb 5, 2008"
48 .SH NAME
49 aio_fsync \- asynchronous file synchronization
50 .SH SYNOPSIS
51 .LP
52 .nf
53 #include <aio.h>
55 \fBint\fR \fBaio_fsync\fR(\fBint\fR \fIop\fR, \fBstruct aiocb *\fR\fIaiocbp\fR);
56 .fi
58 .SH DESCRIPTION
59 .sp
60 .LP
61 The \fBaio_fsync()\fR function asynchronously forces all I/O operations
62 associated with the file indicated by the file descriptor \fBaio_fildes\fR
63 member of the \fBaiocb\fR structure referenced by the \fIaiocbp\fR argument and
64 queued at the time of the call to \fBaio_fsync()\fR to the synchronized I/O
65 completion state. The function call returns when the synchronization request
66 has been initiated or queued to the file or device (even when the data cannot
67 be synchronized immediately).
68 .sp
69 .LP
70 If \fIop\fR is \fBO_DSYNC\fR, all currently queued I/O operations are completed
71 as if by a call to \fBfdatasync\fR(3C); that is, as defined for synchronized
72 I/O data integrity completion. If \fIop\fR is \fBO_SYNC\fR, all currently
73 queued I/O operations are completed as if by a call to \fBfsync\fR(3C); that
74 is, as defined for synchronized I/O file integrity completion. If the
75 \fBaio_fsync()\fR function fails, or if the operation queued by
76 \fBaio_fsync()\fR fails, then, as for \fBfsync\fR(3C) and \fBfdatasync\fR(3C),
77 outstanding I/O operations are not guaranteed to have been completed.
78 .sp
79 .LP
80 If \fBaio_fsync()\fR succeeds, then it is only the I/O that was queued at the
81 time of the call to \fBaio_fsync()\fR that is guaranteed to be forced to the
82 relevant completion state. The completion of subsequent I/O on the file
83 descriptor is not guaranteed to be completed in a synchronized fashion.
84 .sp
85 .LP
86 The \fIaiocbp\fR argument refers to an asynchronous I/O control block. The
87 \fIaiocbp\fR value may be used as an argument to \fBaio_error\fR(3C) and
88 \fBaio_return\fR(3C) in order to determine the error status and return status,
89 respectively, of the asynchronous operation while it is proceeding. When the
90 request is queued, the error status for the operation is \fBEINPROGRESS.\fR
91 When all data has been successfully transferred, the error status will be reset
92 to reflect the success or failure of the operation. If the operation does not
93 complete successfully, the error status for the operation will be set to
94 indicate the error. The \fIaio_sigevent\fR member determines the asynchronous
95 notification to occur when all operations have achieved synchronized I/O
96 completion (see \fBsignal.h\fR(3HEAD)). All other members of the structure
97 referenced by \fIaiocbp\fR are ignored. If the control block referenced by
98 \fIaiocbp\fR becomes an illegal address prior to asynchronous I/O completion,
99 then the behavior is undefined.
102 If the \fBaio_fsync()\fR function fails or the \fIaiocbp\fR indicates an error
103 condition, data is not guaranteed to have been successfully transferred.
106 If \fIaiocbp\fR is \fINULL\fR, then no status is returned in \fIaiocbp\fR, and
107 no signal is generated upon completion of the operation.
108 .SH RETURN VALUES
111 The \fBaio_fsync()\fR function returns \fB0\fR to the calling process if the
112 I/O operation is successfully queued; otherwise, the function returns
113 \fB\(mi1\fR and sets \fBerrno\fR to indicate the error.
114 .SH ERRORS
117 The \fBaio_fsync()\fR function will fail if:
119 .ne 2
121 \fB\fBEAGAIN\fR\fR
123 .RS 10n
124 The requested asynchronous operation was not queued due to temporary resource
125 limitations.
129 .ne 2
131 \fB\fBEBADF\fR\fR
133 .RS 10n
134 The \fBaio_fildes\fR member of the \fBaiocb\fR structure referenced by the
135 \fIaiocbp\fR argument is not a valid file descriptor open for writing.
139 .ne 2
141 \fB\fBEINVAL\fR\fR
143 .RS 10n
144 The system does not support synchronized I/O for this file.
148 .ne 2
150 \fB\fBEINVAL\fR\fR
152 .RS 10n
153 A value of \fIop\fR other than \fBO_DSYNC\fR or \fBO_SYNC\fR was specified.
158 In the event that any of the queued I/O operations fail, \fBaio_fsync()\fR
159 returns the error condition defined for \fBread\fR(2) and \fBwrite\fR(2). The
160 error will be returned in the error status for the asynchronous \fBfsync\fR(3C)
161 operation, which can be retrieved using \fBaio_error\fR(3C).
162 .SH ATTRIBUTES
165 See \fBattributes\fR(5) for descriptions of the following attributes:
170 box;
171 c | c
172 l | l .
173 ATTRIBUTE TYPE  ATTRIBUTE VALUE
175 Interface Stability     Committed
177 MT-Level        MT-Safe
179 Standard        See \fBstandards\fR(5).
182 .SH SEE ALSO
185 \fBfcntl\fR(2), \fBopen\fR(2), \fBread\fR(2), \fBwrite\fR(2),
186 \fBaio_error\fR(3C), \fBaio_return\fR(3C), \fBaio.h\fR(3HEAD),
187 \fBfcntl.h\fR(3HEAD), \fBfdatasync\fR(3C), \fBfsync\fR(3C),
188 \fBsignal.h\fR(3HEAD), \fBattributes\fR(5), \fBstandards\fR(5)