9330 stack overflow when creating a deeply nested dataset
[unleashed.git] / usr / src / man / man3c / aio_suspend.3c
blob5349b1910b0feea9195604c8f364e9d9edadf8a5
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_SUSPEND 3C "Dec 18, 2008"
48 .SH NAME
49 aio_suspend \- wait for asynchronous I/O request
50 .SH SYNOPSIS
51 .LP
52 .nf
53 #include <aio.h>
55 \fBint\fR \fBaio_suspend\fR(\fBconst struct aiocb * const\fR \fIlist\fR[], \fBint\fR \fInent\fR,
56      \fBconst struct timespec *\fR\fItimeout\fR);
57 .fi
59 .SH DESCRIPTION
60 .sp
61 .LP
62 The \fBaio_suspend()\fR function suspends the calling thread  until at least
63 one of the asynchronous I/O operations referenced by the \fIlist\fR argument
64 has completed, until a signal interrupts the function, or, if \fItimeout\fR is
65 not \fINULL\fR, until the time interval specified by \fItimeout\fR has passed.
66 If any of the \fBaiocb\fR structures in the list correspond to completed
67 asynchronous I/O operations (that is, the error status for the operation is not
68 equal to \fBEINPROGRESS\fR) at the time of the call, the function returns
69 without suspending the calling thread. The \fIlist\fR argument is an array of
70 pointers to asynchronous I/O control blocks. The \fInent\fR argument indicates
71 the number of elements in the array and is limited to \fB_AIO_LISTIO_MAX\fR =
72 4096. Each \fBaiocb\fR structure pointed to will have been used in initiating
73 an asynchronous I/O request via \fBaio_read\fR(3C), \fBaio_write\fR(3C), or
74 \fBlio_listio\fR(3C). This array may contain null pointers, which are ignored.
75 If this array contains pointers that refer to \fBaiocb\fR structures that have
76 not been used in submitting asynchronous I/O, the effect is undefined.
77 .sp
78 .LP
79 If the time interval indicated in the \fBtimespec\fR structure pointed to by
80 \fItimeout\fR passes before any of the I/O operations referenced by \fIlist\fR
81 are completed, then \fBaio_suspend()\fR returns with an error.
82 .SH RETURN VALUES
83 .sp
84 .LP
85 If \fBaio_suspend()\fR returns after one or more asynchronous I/O operations
86 have completed, it returns \fB0\fR. Otherwise, it returns \fB\(mi1\fR, and sets
87 \fBerrno\fR to indicate the error.
88 .sp
89 .LP
90 The application may determine which asynchronous I/O completed by scanning the
91 associated error and return status using \fBaio_error\fR(3C) and
92 \fBaio_return\fR(3C), respectively.
93 .SH ERRORS
94 .sp
95 .LP
96 The \fBaio_suspend()\fR function will fail if:
97 .sp
98 .ne 2
99 .na
100 \fB\fBEAGAIN\fR \fR
102 .RS 11n
103 No asynchronous I/O indicated in the list referenced by \fIlist\fR completed in
104 the time interval indicated by \fItimeout\fR.
108 .ne 2
110 \fB\fBEINTR\fR \fR
112 .RS 11n
113 A signal interrupted the \fBaio_suspend()\fR function. Since each asynchronous
114 I/O operation might provoke a signal when it completes, this error return can
115 be caused by the completion of one or more of the very I/O operations being
116 awaited.
120 .ne 2
122 \fB\fBEINVAL\fR\fR
124 .RS 11n
125 The \fInent\fR argument is less than or equal to 0 or greater than
126 \fB_AIO_LISTIO_MAX\fR, or the \fBtimespec\fR structure pointed to by
127 \fItimeout\fR is not properly set because \fItv_sec\fR is less than 0 or
128 \fItv_nsec\fR is either less than 0 or greater than 10^9.
132 .ne 2
134 \fB\fBENOMEM\fR\fR
136 .RS 11n
137 There is currently not enough available memory; the application can try again
138 later.
142 .ne 2
144 \fB\fBENOSYS\fR \fR
146 .RS 11n
147 The \fBaio_suspend()\fR function is not supported by the system.
150 .SH USAGE
153 The \fBaio_suspend()\fR function has a transitional interface for 64-bit file
154 offsets.  See \fBlf64\fR(5).
155 .SH ATTRIBUTES
158 See \fBattributes\fR(5) for descriptions of the following attributes:
163 box;
164 c | c
165 l | l .
166 ATTRIBUTE TYPE  ATTRIBUTE VALUE
168 Interface Stability     Committed
170 MT-Level        Async-Signal-Safe
172 Standard        See \fBstandards\fR(5).
175 .SH SEE ALSO
178 \fBaio.h\fR(3HEAD), \fBaio_fsync\fR(3C), \fBaio_read\fR(3C),
179 \fBaio_return\fR(3C), \fBaio_write\fR(3C), \fBlio_listio\fR(3C),
180 \fBsignal.h\fR(3HEAD), \fBattributes\fR(5), \fBlf64\fR(5), \fBstandards\fR(5)
181 .SH NOTES
184 Solaris 2.6 was the first release to support the Asynchronous Input and Output
185 option. Prior to this release, this function always returned \fB\(mi1\fR and
186 set \fBerrno\fR to \fBENOSYS\fR.