AIOWAIT(3C) | Standard C Library Functions | AIOWAIT(3C) |
aiowait - wait for completion of asynchronous I/O operation
#include <sys/asynch.h> #include <sys/time.h> aio_result_t *aiowait(const struct timeval *timeout);
The aiowait() function suspends the calling process until one of its outstanding asynchronous I/O operations completes, providing a synchronous method of notification.
If timeout is a non-zero pointer, it specifies a maximum interval to wait for the completion of an asynchronous I/O operation. If timeout is a zero pointer, aiowait() blocks indefinitely. To effect a poll, the timeout parameter should be non-zero, pointing to a zero-valued timeval structure.
The timeval structure is defined in <sys/time.h> and contains the following members:
long tv_sec; /* seconds */ long tv_usec; /* and microseconds */
Upon successful completion, aiowait() returns a pointer to the result structure used when the completed asynchronous I/O operation was requested. Upon failure, aiowait() returns −1 and sets errno to indicate the error. aiowait() returns 0 if the time limit expires.
The aiowait() function will fail if:
EFAULT
EINTR
EINVAL
EINVAL
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
MT-Level | Safe |
The aiowait() function is the only way to dequeue an asynchronous notification. It can be used either inside a SIGIO signal handler or in the main program. One SIGIO signal can represent several queued events.
Passing an illegal address as timeout will result in setting errno to EFAULT only if detected by the application process.
February 5, 2008 | OmniOS |