1AIO_SUSPEND(P) POSIX Programmer's Manual AIO_SUSPEND(P)
2
3
4
6 aio_suspend - wait for an asynchronous I/O request (REALTIME)
7
9 #include <aio.h>
10
11 int aio_suspend(const struct aiocb * const list[], int nent,
12 const struct timespec *timeout);
13
14
16 The aio_suspend() function shall suspend the calling thread until at
17 least one of the asynchronous I/O operations referenced by the list
18 argument has completed, until a signal interrupts the function, or, if
19 timeout is not NULL, until the time interval specified by timeout has
20 passed. If any of the aiocb structures in the list correspond to com‐
21 pleted asynchronous I/O operations (that is, the error status for the
22 operation is not equal to [EINPROGRESS]) at the time of the call, the
23 function shall return without suspending the calling thread. The list
24 argument is an array of pointers to asynchronous I/O control blocks.
25 The nent argument indicates the number of elements in the array. Each
26 aiocb structure pointed to has been used in initiating an asynchronous
27 I/O request via aio_read(), aio_write(), or lio_listio(). This array
28 may contain NULL pointers, which are ignored. If this array contains
29 pointers that refer to aiocb structures that have not been used in sub‐
30 mitting asynchronous I/O, the effect is undefined.
31
32 If the time interval indicated in the timespec structure pointed to by
33 timeout passes before any of the I/O operations referenced by list are
34 completed, then aio_suspend() shall return with an error. If the
35 Monotonic Clock option is supported, the clock that shall be used to
36 measure this time interval shall be the CLOCK_MONOTONIC clock.
37
39 If the aio_suspend() function returns after one or more asynchronous
40 I/O operations have completed, the function shall return zero. Other‐
41 wise, the function shall return a value of -1 and set errno to indicate
42 the error.
43
44 The application may determine which asynchronous I/O completed by scan‐
45 ning the associated error and return status using aio_error() and
46 aio_return(), respectively.
47
49 The aio_suspend() function shall fail if:
50
51 EAGAIN No asynchronous I/O indicated in the list referenced by list
52 completed in the time interval indicated by timeout.
53
54 EINTR A signal interrupted the aio_suspend() function. Note that,
55 since each asynchronous I/O operation may possibly provoke a
56 signal when it completes, this error return may be caused by the
57 completion of one (or more) of the very I/O operations being
58 awaited.
59
60
61 The following sections are informative.
62
64 None.
65
67 The aio_suspend() function is part of the Asynchronous Input and Output
68 option and need not be available on all implementations.
69
71 None.
72
74 None.
75
77 aio_read() , aio_write() , lio_listio() , the Base Definitions volume
78 of IEEE Std 1003.1-2001, <aio.h>
79
81 Portions of this text are reprinted and reproduced in electronic form
82 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
83 -- Portable Operating System Interface (POSIX), The Open Group Base
84 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
85 Electrical and Electronics Engineers, Inc and The Open Group. In the
86 event of any discrepancy between this version and the original IEEE and
87 The Open Group Standard, the original IEEE and The Open Group Standard
88 is the referee document. The original Standard can be obtained online
89 at http://www.opengroup.org/unix/online.html .
90
91
92
93IEEE/The Open Group 2003 AIO_SUSPEND(P)