1AIO_SUSPEND(3P) POSIX Programmer's Manual AIO_SUSPEND(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
11
13 aio_suspend — wait for an asynchronous I/O request
14
16 #include <aio.h>
17
18 int aio_suspend(const struct aiocb *const list[], int nent,
19 const struct timespec *timeout);
20
22 The aio_suspend() function shall suspend the calling thread until at
23 least one of the asynchronous I/O operations referenced by the list
24 argument has completed, until a signal interrupts the function, or, if
25 timeout is not NULL, until the time interval specified by timeout has
26 passed. If any of the aiocb structures in the list correspond to com‐
27 pleted asynchronous I/O operations (that is, the error status for the
28 operation is not equal to [EINPROGRESS]) at the time of the call, the
29 function shall return without suspending the calling thread. The list
30 argument is an array of pointers to asynchronous I/O control blocks.
31 The nent argument indicates the number of elements in the array. Each
32 aiocb structure pointed to has been used in initiating an asynchronous
33 I/O request via aio_read(), aio_write(), or lio_listio(). This array
34 may contain null pointers, which are ignored. If this array contains
35 pointers that refer to aiocb structures that have not been used in sub‐
36 mitting asynchronous I/O, the effect is undefined.
37
38 If the time interval indicated in the timespec structure pointed to by
39 timeout passes before any of the I/O operations referenced by list are
40 completed, then aio_suspend() shall return with an error. If the Mono‐
41 tonic Clock option is supported, the clock that shall be used to mea‐
42 sure this time interval shall be the CLOCK_MONOTONIC clock.
43
45 If the aio_suspend() function returns after one or more asynchronous
46 I/O operations have completed, the function shall return zero. Other‐
47 wise, the function shall return a value of −1 and set errno to indicate
48 the error.
49
50 The application may determine which asynchronous I/O completed by scan‐
51 ning the associated error and return status using aio_error() and
52 aio_return(), respectively.
53
55 The aio_suspend() function shall fail if:
56
57 EAGAIN No asynchronous I/O indicated in the list referenced by list
58 completed in the time interval indicated by timeout.
59
60 EINTR A signal interrupted the aio_suspend() function. Note that,
61 since each asynchronous I/O operation may possibly provoke a
62 signal when it completes, this error return may be caused by the
63 completion of one (or more) of the very I/O operations being
64 awaited.
65
66 The following sections are informative.
67
69 None.
70
72 None.
73
75 None.
76
78 None.
79
81 aio_read(), aio_write(), lio_listio()
82
83 The Base Definitions volume of POSIX.1‐2008, <aio.h>
84
86 Portions of this text are reprinted and reproduced in electronic form
87 from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
88 -- Portable Operating System Interface (POSIX), The Open Group Base
89 Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
90 cal and Electronics Engineers, Inc and The Open Group. (This is
91 POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
92 event of any discrepancy between this version and the original IEEE and
93 The Open Group Standard, the original IEEE and The Open Group Standard
94 is the referee document. The original Standard can be obtained online
95 at http://www.unix.org/online.html .
96
97 Any typographical or formatting errors that appear in this page are
98 most likely to have been introduced during the conversion of the source
99 files to man page format. To report such errors, see https://www.ker‐
100 nel.org/doc/man-pages/reporting_bugs.html .
101
102
103
104IEEE/The Open Group 2013 AIO_SUSPEND(3P)