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
12 aio_suspend - wait for an asynchronous I/O request (REALTIME)
13
15 #include <aio.h>
16
17 int aio_suspend(const struct aiocb * const list[], int nent,
18 const struct timespec *timeout);
19
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
67 The following sections are informative.
68
70 None.
71
73 The aio_suspend() function is part of the Asynchronous Input and Output
74 option and need not be available on all implementations.
75
77 None.
78
80 None.
81
83 aio_read(), aio_write(), lio_listio(), the Base Definitions volume of
84 IEEE Std 1003.1-2001, <aio.h>
85
87 Portions of this text are reprinted and reproduced in electronic form
88 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
89 -- Portable Operating System Interface (POSIX), The Open Group Base
90 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
91 Electrical and Electronics Engineers, Inc and The Open Group. 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.opengroup.org/unix/online.html .
96
97
98
99IEEE/The Open Group 2003 AIO_SUSPEND(3P)