2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
3 .\" Copyright 1989 AT&T
4 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/.
6 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text
7 .\" are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical
8 .\" and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
9 .\" This notice shall appear on any product containing this material.
10 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
11 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
12 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
13 .TH AIO_SUSPEND 3C "Dec 18, 2008"
15 aio_suspend \- wait for asynchronous I/O request
21 \fBint\fR \fBaio_suspend\fR(\fBconst struct aiocb * const\fR \fIlist\fR[], \fBint\fR \fInent\fR,
22 \fBconst struct timespec *\fR\fItimeout\fR);
28 The \fBaio_suspend()\fR function suspends the calling thread until at least
29 one of the asynchronous I/O operations referenced by the \fIlist\fR argument
30 has completed, until a signal interrupts the function, or, if \fItimeout\fR is
31 not \fINULL\fR, until the time interval specified by \fItimeout\fR has passed.
32 If any of the \fBaiocb\fR structures in the list correspond to completed
33 asynchronous I/O operations (that is, the error status for the operation is not
34 equal to \fBEINPROGRESS\fR) at the time of the call, the function returns
35 without suspending the calling thread. The \fIlist\fR argument is an array of
36 pointers to asynchronous I/O control blocks. The \fInent\fR argument indicates
37 the number of elements in the array and is limited to \fB_AIO_LISTIO_MAX\fR =
38 4096. Each \fBaiocb\fR structure pointed to will have been used in initiating
39 an asynchronous I/O request via \fBaio_read\fR(3C), \fBaio_write\fR(3C), or
40 \fBlio_listio\fR(3C). This array may contain null pointers, which are ignored.
41 If this array contains pointers that refer to \fBaiocb\fR structures that have
42 not been used in submitting asynchronous I/O, the effect is undefined.
45 If the time interval indicated in the \fBtimespec\fR structure pointed to by
46 \fItimeout\fR passes before any of the I/O operations referenced by \fIlist\fR
47 are completed, then \fBaio_suspend()\fR returns with an error.
51 If \fBaio_suspend()\fR returns after one or more asynchronous I/O operations
52 have completed, it returns \fB0\fR. Otherwise, it returns \fB\(mi1\fR, and sets
53 \fBerrno\fR to indicate the error.
56 The application may determine which asynchronous I/O completed by scanning the
57 associated error and return status using \fBaio_error\fR(3C) and
58 \fBaio_return\fR(3C), respectively.
62 The \fBaio_suspend()\fR function will fail if:
69 No asynchronous I/O indicated in the list referenced by \fIlist\fR completed in
70 the time interval indicated by \fItimeout\fR.
79 A signal interrupted the \fBaio_suspend()\fR function. Since each asynchronous
80 I/O operation might provoke a signal when it completes, this error return can
81 be caused by the completion of one or more of the very I/O operations being
91 The \fInent\fR argument is less than or equal to 0 or greater than
92 \fB_AIO_LISTIO_MAX\fR, or the \fBtimespec\fR structure pointed to by
93 \fItimeout\fR is not properly set because \fItv_sec\fR is less than 0 or
94 \fItv_nsec\fR is either less than 0 or greater than 10^9.
103 There is currently not enough available memory; the application can try again
113 The \fBaio_suspend()\fR function is not supported by the system.
119 The \fBaio_suspend()\fR function has a transitional interface for 64-bit file
120 offsets. See \fBlf64\fR(5).
124 See \fBattributes\fR(5) for descriptions of the following attributes:
132 ATTRIBUTE TYPE ATTRIBUTE VALUE
134 Interface Stability Committed
136 MT-Level Async-Signal-Safe
138 Standard See \fBstandards\fR(5).
144 \fBaio.h\fR(3HEAD), \fBaio_fsync\fR(3C), \fBaio_read\fR(3C),
145 \fBaio_return\fR(3C), \fBaio_write\fR(3C), \fBlio_listio\fR(3C),
146 \fBsignal.h\fR(3HEAD), \fBattributes\fR(5), \fBlf64\fR(5), \fBstandards\fR(5)
150 Solaris 2.6 was the first release to support the Asynchronous Input and Output
151 option. Prior to this release, this function always returned \fB\(mi1\fR and
152 set \fBerrno\fR to \fBENOSYS\fR.