]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) |
31cc8387 | 2 | .\" and Copyright (C) 2010 Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da | 3 | .\" |
1dd72f9c | 4 | .\" %%%LICENSE_START(GPLv2+_DOC_FULL) |
fea681da MK |
5 | .\" This is free documentation; you can redistribute it and/or |
6 | .\" modify it under the terms of the GNU General Public License as | |
7 | .\" published by the Free Software Foundation; either version 2 of | |
8 | .\" the License, or (at your option) any later version. | |
9 | .\" | |
10 | .\" The GNU General Public License's references to "object code" | |
11 | .\" and "executables" are to be interpreted as the output of any | |
12 | .\" document formatting or typesetting system, including | |
13 | .\" intermediate and printed output. | |
14 | .\" | |
15 | .\" This manual is distributed in the hope that it will be useful, | |
16 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | .\" GNU General Public License for more details. | |
19 | .\" | |
20 | .\" You should have received a copy of the GNU General Public | |
c715f741 MK |
21 | .\" License along with this manual; if not, see |
22 | .\" <http://www.gnu.org/licenses/>. | |
6a8d8745 | 23 | .\" %%%LICENSE_END |
fea681da | 24 | .\" |
fe0fefbf | 25 | .TH AIO_SUSPEND 3 2015-03-02 "" "Linux Programmer's Manual" |
fea681da MK |
26 | .SH NAME |
27 | aio_suspend \- wait for asynchronous I/O operation or timeout | |
28 | .SH SYNOPSIS | |
29 | .nf | |
30 | .sp | |
31 | .B "#include <aio.h>" | |
32 | .sp | |
0cae8d0c | 33 | .BI "int aio_suspend(const struct aiocb * const " aiocb_list [], |
fea681da | 34 | .br |
0cae8d0c | 35 | .BI " int " nitems ", const struct timespec *" timeout ); |
8d3d329b MK |
36 | .sp |
37 | Link with \fI\-lrt\fP. | |
fea681da MK |
38 | .fi |
39 | .SH DESCRIPTION | |
40 | The | |
e511ffb6 | 41 | .BR aio_suspend () |
0cae8d0c MK |
42 | function suspends the calling thread until one of the following occurs: |
43 | .IP * 3 | |
44 | One or more of the asynchronous I/O requests in the list | |
45 | .I aiocb_list | |
46 | has completed. | |
47 | .IP * | |
48 | A signal is delivered. | |
49 | .IP * | |
fea681da | 50 | .I timeout |
0cae8d0c MK |
51 | is not NULL and the specified time interval has passed. |
52 | (For details of the | |
53 | .I timespec | |
54 | structure, see | |
55 | .BR nanosleep (2).) | |
fea681da | 56 | .LP |
0cae8d0c MK |
57 | The |
58 | .I nitems | |
59 | argument specifies the number of items in | |
60 | .IR aiocb_list . | |
61 | Each item in the list pointed to by | |
62 | .I aiocb_list | |
63 | must be either NULL (and then is ignored), | |
fea681da MK |
64 | or a pointer to a control block on which I/O was initiated using |
65 | .BR aio_read (3), | |
66 | .BR aio_write (3), | |
67 | or | |
68 | .BR lio_listio (3). | |
0cae8d0c MK |
69 | (See |
70 | .BR aio (7) | |
71 | for a description of the | |
72 | .I aiocb | |
73 | structure.) | |
fea681da | 74 | .LP |
2f0af33b MK |
75 | If |
76 | .B CLOCK_MONOTONIC | |
77 | is supported, this clock is used to measure | |
0cae8d0c MK |
78 | the timeout interval (see |
79 | .BR clock_gettime (3)). | |
47297adb | 80 | .SH RETURN VALUE |
0cae8d0c MK |
81 | If this function returns after completion of one of the I/O |
82 | requests specified in | |
83 | .IR aiocb_list , | |
84 | 0 is returned. | |
85 | Otherwise, \-1 is returned, and | |
fea681da | 86 | .I errno |
0cae8d0c | 87 | is set to indicate the error. |
fea681da MK |
88 | .SH ERRORS |
89 | .TP | |
90 | .B EAGAIN | |
0cae8d0c | 91 | The call timed out before any of the indicated operations |
fea681da MK |
92 | had completed. |
93 | .TP | |
94 | .B EINTR | |
0cae8d0c MK |
95 | The call was ended by signal |
96 | (possibly the completion signal of one of the operations we were | |
97 | waiting for); see | |
76e533c4 | 98 | .BR signal (7). |
aea038d6 MK |
99 | .TP |
100 | .B ENOSYS | |
02ace852 | 101 | .BR aio_suspend () |
aea038d6 | 102 | is not implemented. |
793514ae MK |
103 | .SH VERSIONS |
104 | The | |
105 | .BR aio_suspend () | |
106 | function is available since glibc 2.1. | |
2bddd251 MS |
107 | .SH ATTRIBUTES |
108 | For an explanation of the terms used in this section, see | |
109 | .BR attributes (7). | |
110 | .TS | |
111 | allbox; | |
112 | lb lb lb | |
113 | l l l. | |
114 | Interface Attribute Value | |
115 | T{ | |
116 | .BR aio_suspend () | |
117 | T} Thread safety MT-Safe | |
118 | .TE | |
47297adb | 119 | .SH CONFORMING TO |
793514ae | 120 | POSIX.1-2001, POSIX.1-2008. |
19c98696 | 121 | .SH NOTES |
fea681da MK |
122 | One can achieve polling by using a non-NULL |
123 | .I timeout | |
124 | that specifies a zero time interval. | |
0cae8d0c MK |
125 | |
126 | If one or more of the asynchronous I/O operations specified in | |
127 | .IR aiocb_list | |
128 | has already completed at the time of the call to | |
129 | .BR aio_suspend (), | |
130 | then the call returns immediately. | |
131 | ||
132 | To determine which I/O operations have completed | |
133 | after a successful return from | |
134 | .BR aio_suspend (), | |
135 | use | |
136 | .BR aio_error (3) | |
137 | to scan the list of | |
138 | .I aiocb | |
139 | structures pointed to by | |
140 | .IR aiocb_list . | |
47297adb | 141 | .SH SEE ALSO |
fea681da MK |
142 | .BR aio_cancel (3), |
143 | .BR aio_error (3), | |
144 | .BR aio_fsync (3), | |
145 | .BR aio_read (3), | |
146 | .BR aio_return (3), | |
1d7c4d16 | 147 | .BR aio_write (3), |
cd587df6 | 148 | .BR lio_listio (3), |
25fa6c3d | 149 | .BR aio (7), |
1d7c4d16 | 150 | .BR time (7) |