aio_suspend(2)aio_suspend(2)NAMEaio_suspend() - wait for an asynchronous I/O operation to complete
The function suspends the calling process or thread until at least one
of the asynchronous I/O operations initiated with one of the pointers
contained in has completed, or a signal interrupts the function, or
timeout is not and the time interval specified by timeout has passed.
Multiple threads may issue simultaneous calls to referencing one or
more in common.
To use this function, link in the realtime library by specifying on the
compiler or linker command line.
returns the following values:
Either there were no in or at least one of the
asynchronous I/O operations enqueued for an ref‐
erenced by has completed. The completion status
of the referenced asynchronous I/O operations
must be determined using and for each relevant
Failure. The process thread is not suspended and is set to
indicate the error.
If any of the indicated asynchronous I/O operations has already com‐
pleted at the time of the call to then returns immediately. If is 0
(zero), the immediately returns success. Any in is silently ignored.
If all of the in are the immediately returns success.
If detects one of the following error conditions, is set to the indi‐
[EAGAIN] System-wide or per-process resources were not
available to process the request.
[EAGAIN] The time interval specified in the referenced by
timeout passed before any of the asynchronous I/O
operations enqueued for one of the entries refer‐
enced in completed.
[EINVAL] The value of the argument was negative or
exceeded the maximum value allowed. The maximum
value allowed can be obtained using the call with
[EINVAL] One or more of the pointers in does not identify
an asynchronous operation enqueued by or and for
which has not yet been called. pointers associ‐
ated with will yield this error.
[EINTR] A signal was delivered to the process while was
waiting. Completion of asynchronous operations
can cause signal delivery.
SEE ALSOaio_cancel(2), aio_error(2), aio_fsync(2), aio_read(2), aio_return(2),
aio_write(2), lio_listio(2), pause(2), aio(5).