]>
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 | .\" |
4b8c67d9 | 25 | .TH AIO_SUSPEND 3 2017-09-15 "" "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 | |
68e4db0a | 30 | .PP |
fea681da | 31 | .B "#include <aio.h>" |
68e4db0a | 32 | .PP |
0cae8d0c | 33 | .BI "int aio_suspend(const struct aiocb * const " aiocb_list [], |
0cae8d0c | 34 | .BI " int " nitems ", const struct timespec *" timeout ); |
68e4db0a | 35 | .PP |
8d3d329b | 36 | Link with \fI\-lrt\fP. |
fea681da MK |
37 | .fi |
38 | .SH DESCRIPTION | |
39 | The | |
e511ffb6 | 40 | .BR aio_suspend () |
0cae8d0c MK |
41 | function suspends the calling thread until one of the following occurs: |
42 | .IP * 3 | |
43 | One or more of the asynchronous I/O requests in the list | |
44 | .I aiocb_list | |
45 | has completed. | |
46 | .IP * | |
47 | A signal is delivered. | |
48 | .IP * | |
fea681da | 49 | .I timeout |
0cae8d0c MK |
50 | is not NULL and the specified time interval has passed. |
51 | (For details of the | |
52 | .I timespec | |
53 | structure, see | |
54 | .BR nanosleep (2).) | |
dd3568a1 | 55 | .PP |
0cae8d0c MK |
56 | The |
57 | .I nitems | |
58 | argument specifies the number of items in | |
59 | .IR aiocb_list . | |
60 | Each item in the list pointed to by | |
61 | .I aiocb_list | |
62 | must be either NULL (and then is ignored), | |
fea681da MK |
63 | or a pointer to a control block on which I/O was initiated using |
64 | .BR aio_read (3), | |
65 | .BR aio_write (3), | |
66 | or | |
67 | .BR lio_listio (3). | |
0cae8d0c MK |
68 | (See |
69 | .BR aio (7) | |
70 | for a description of the | |
71 | .I aiocb | |
72 | structure.) | |
dd3568a1 | 73 | .PP |
2f0af33b MK |
74 | If |
75 | .B CLOCK_MONOTONIC | |
76 | is supported, this clock is used to measure | |
0cae8d0c MK |
77 | the timeout interval (see |
78 | .BR clock_gettime (3)). | |
47297adb | 79 | .SH RETURN VALUE |
0cae8d0c MK |
80 | If this function returns after completion of one of the I/O |
81 | requests specified in | |
82 | .IR aiocb_list , | |
83 | 0 is returned. | |
84 | Otherwise, \-1 is returned, and | |
fea681da | 85 | .I errno |
0cae8d0c | 86 | is set to indicate the error. |
fea681da MK |
87 | .SH ERRORS |
88 | .TP | |
89 | .B EAGAIN | |
0cae8d0c | 90 | The call timed out before any of the indicated operations |
fea681da MK |
91 | had completed. |
92 | .TP | |
93 | .B EINTR | |
0cae8d0c MK |
94 | The call was ended by signal |
95 | (possibly the completion signal of one of the operations we were | |
96 | waiting for); see | |
76e533c4 | 97 | .BR signal (7). |
aea038d6 MK |
98 | .TP |
99 | .B ENOSYS | |
02ace852 | 100 | .BR aio_suspend () |
aea038d6 | 101 | is not implemented. |
793514ae MK |
102 | .SH VERSIONS |
103 | The | |
104 | .BR aio_suspend () | |
105 | function is available since glibc 2.1. | |
2bddd251 MS |
106 | .SH ATTRIBUTES |
107 | For an explanation of the terms used in this section, see | |
108 | .BR attributes (7). | |
109 | .TS | |
110 | allbox; | |
111 | lb lb lb | |
112 | l l l. | |
113 | Interface Attribute Value | |
114 | T{ | |
115 | .BR aio_suspend () | |
116 | T} Thread safety MT-Safe | |
117 | .TE | |
47297adb | 118 | .SH CONFORMING TO |
793514ae | 119 | POSIX.1-2001, POSIX.1-2008. |
19c98696 | 120 | .SH NOTES |
fea681da MK |
121 | One can achieve polling by using a non-NULL |
122 | .I timeout | |
123 | that specifies a zero time interval. | |
847e0d88 | 124 | .PP |
0cae8d0c MK |
125 | If one or more of the asynchronous I/O operations specified in |
126 | .IR aiocb_list | |
127 | has already completed at the time of the call to | |
128 | .BR aio_suspend (), | |
129 | then the call returns immediately. | |
847e0d88 | 130 | .PP |
0cae8d0c MK |
131 | To determine which I/O operations have completed |
132 | after a successful return from | |
133 | .BR aio_suspend (), | |
134 | use | |
135 | .BR aio_error (3) | |
136 | to scan the list of | |
137 | .I aiocb | |
138 | structures pointed to by | |
139 | .IR aiocb_list . | |
aa30b327 MK |
140 | .SH BUGS |
141 | The glibc implementation of | |
142 | .BR aio_suspend () | |
143 | is not async-signal-safe, | |
144 | .\" FIXME . https://sourceware.org/bugzilla/show_bug.cgi?id=13172 | |
0f895aa0 | 145 | in violation of the requirements of POSIX.1. |
47297adb | 146 | .SH SEE ALSO |
fea681da MK |
147 | .BR aio_cancel (3), |
148 | .BR aio_error (3), | |
149 | .BR aio_fsync (3), | |
150 | .BR aio_read (3), | |
151 | .BR aio_return (3), | |
1d7c4d16 | 152 | .BR aio_write (3), |
cd587df6 | 153 | .BR lio_listio (3), |
25fa6c3d | 154 | .BR aio (7), |
1d7c4d16 | 155 | .BR time (7) |