[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    aio_suspend(3R) manual page Table of Contents

Name

aio_suspend - wait for asynchronous I/O request

Synopsis

cc [ flag ... ] file ... -lposix4 [ library ... ]

#include <aio.h>

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

MT-Level

Async-Signal-Safe

Description

aio_suspend() suspends the caller until at least one of the asynchronous I/O operations referenced by list has completed, until a signal interrupts the function, or, if timeout is not NULL , until the time interval specified by timeout has passed. If any of the aiocb structures in the list corresponds to a completed asynchronous I/O operation (i.e., the error status for the operation is not equal to EINPROGRESS), at the time of the call, the function returns without suspending the caller.

If the time interval indicated in the timespec structure pointed to by timeout passes before any of the I/O operations referenced by list are completed, then aio_suspend() returns with an error.

list is an array of pointers to asynchronous I/O control blocks. nent indicates the number of elements in this array. Each aiocb structure pointed to must have been used in initiating an asynchronous I/O request via aio_read(3R) , aio_write(3R) , aio_fsync(3R) , or lio_listio(3R) . This array may contain NULL pointers which will be ignored.

struct aiocb {
intaio_fildes;/* file descriptor */
volatile void*aio_buf;/* buffer location */
size_taio_nbytes;/* length of transfer */
off_taio_offset;/* file offset */
intaio_reqprio;/* request priority offset */
struct sigeventaio_sigevent;/* signal number and offset */
intaio_lio_opcode;/* listio operation */
};

struct sigevent {
intsigev_notify;/* notification mode */
intsigev_signo;/* signal number */
union sigvalsigev_value;/* signal value */
};

union sigval {
intsival_int;/* integer value */
void*sival_ptr;/* pointer value */
};

struct timespec {
time_ttv_sec;/* seconds */
longtv_nsec;/* and nanoseconds */
};

Return Values

If aio_suspend() returns after one or more asynchronous I/O operations have completed, it returns 0. Otherwise, it returns -1, and sets errno to indicate the error condition.

The application may determine which asynchronous I/O had completed with both the associated error and return status of aio_return(3R) , and aio_error(3R) .

Errors

EAGAIN
No asynchronous I/O indicated in the list referenced by list completed in the time interval indicated by timeout.
EINTR
A signal interrupted the aio_suspen() function. Note that, since each asynchronous I/O operation may possibly provoke a signal when it completes, this error return may be caused by the completion of one (or more) of the very I/O operations being awaited.
ENOSYS
aio_suspend() is not supported by this implementation.

See Also

aio_fsync(3R) , aio_read(3R) , aio_return(3R) , aio_write(3R) , lio_listio(3R)

Notes

Applications compiled under Solaris 2.3 and 2.4 and using POSIX aio must be recompiled to work correctly when Solaris supports the Asynchronous Input and Output option.

Bugs

In Solaris 2.5, these functions always return -1 and set errno to ENOSYS, because this release does not support the Asynchronous Input and Output option. It is our intention to provide support for these interfaces in future releases.


Table of Contents