Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > A


HP-UX 11i Version 3: February 2007

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index


aio_suspend() — wait for an asynchronous I/O operation to complete


#include <aio.h>

int aio_suspend(const struct aiocb * const list[], int nent, const struct timespec *timeout);


The aio_suspend() function suspends the calling process or thread until at least one of the asynchronous I/O operations initiated with one of the nent aiocb pointers contained in list has completed, or a signal interrupts the function, or timeout is not NULL and the time interval specified by timeout has passed.

Multiple threads may issue simultaneous calls to aio_suspend(), referencing one or more aiocbs in common.

To use this function, link in the realtime library by specifying -lrt on the compiler or linker command line.


aio_suspend() returns the following values:


Successful completion. Either there were no non-NULL aiocbs in list or at least one of the asynchronous I/O operations enqueued for an aiocb referenced by list has completed. The completion status of the referenced asynchronous I/O operations must be determined using aio_error() and aio_return() for each relevant aiocb.


Failure. The process thread is not suspended and errno is set to indicate the error.

If any of the indicated asynchronous I/O operations has already completed at the time of the call to aio_suspend(), then aio_suspend() returns immediately. If nent is 0 (zero), the aio_suspend() immediately returns success. Any NULL aiocb in list is silently ignored. If all of the aiocbs in list are NULL, the aio_suspend() immediately returns success.


If aio_suspend() detects one of the following error conditions, errno is set to the indicated value:


System-wide or per-process resources were not available to process the request.


The time interval specified in the timespec referenced by timeout passed before any of the asynchronous I/O operations enqueued for one of the aiocb entries referenced in list completed.


The value of the nent argument was negative or exceeded the maximum value allowed. The maximum value allowed can be obtained using the sysconf() call with the argument _SC_AIO_MAX.


One or more of the aiocb pointers in list does not identify an asynchronous operation enqueued by aio_read(), aio_write(), or lio_listio(), and for which aio_return() has not yet been called. aiocb pointers associated with aio_fsync() will yield this error.


A signal was delivered to the process while aio_suspend() was waiting. Completion of asynchronous operations can cause signal delivery.


aio_suspend(): POSIX Realtime Extensions, IEEE Std 1003.1b

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.