aio_return

Date:

10-20-2011

NAME

aio_return - Returns error status of an asynchronous I/O operation

SYNOPSIS

#include <aio.h>

ssize_t aio_return(aiocb_t *aiocbp);

DESCRIPTION

The aio_return function returns the return status associated with the aiocbp passed in. The return status for an asynchronous I/O operation is the value that would be returned by the corresponding read, write, or fsync operation. If the error status for the operation is equal to EINPROGRESS, then the return status for the operation is undefined.

The aio_return function may be called exactly once to retrieve the return status of a given asynchronous operation; thereafter, if the same aiocb structure is used in a call to aio_return or aio_error, an error may be returned. The aio_return function must be called to remove completed requests from the library queues. Failure to remove completed requests may result in the inability to queue new requests.

RETURN VALUES

If the asynchronous I/O operation has completed, then the return status as described for read, write, and fsync are returned. If the asynchronous operation has not yet completed, then the results of aio_return are undefined. The aio_error or aio_suspend functions can be used to ensure that an asynchronous I/O operation has completed.

MESSAGES

If the following condition occurs, the aio_return function returns -1 and sets errno to the corresponding value.

EINVAL

The aiocbp argument refers to an asynchronous operation whose return status has already been retrieved.

SEE ALSO

aio_cancel(3c), aio_error(3c), aio_init(3c), aio_read(3c), aio_write(3c), lio_listio(3c)