aio_error() — Retrieve error status for an asynchronous I/O operation

Standards

Standards / Extensions C or C++ Dependencies

Single UNIX Specification, Version 2
Single UNIX Specification, Version 3

both

OS/390 V2R7

Format

#define _XOPEN_SOURCE 500
#include <aio.h>

int aio_error(const struct aiocb *aiocbp);

General description

The aio_error() function returns the error status associated with the aiocb structure referenced by the aiocbp argument. The error status for an asynchronous I/O operation is the errno value that would be set by the corresponding read(), or write() operation. If the operation has not yet completed, then the error status will be equal to EINPROGRESS.

Returned value

If the asynchronous I/O operation has completed successfully, aio_error() returns 0.

If the asynchronous I/O operation has completed unsuccessfully, aio_error() returns the error status as described for read(), or write().

If the asynchronous I/O operation has not yet completed, then EINPROGRESS is returned.

aio_error() does not set errno.

When the errno is returned is not EINPROGRESS and not zero, the errno2 set by either read() or write() can be retrieved by using the __errno2() function.

Related information