If the asynchronous I/O request has completed successfully,
aio_error() returns 0. If the request has not yet completed,
EINPROGRESS is returned. If the request has completed unsuccessfully the error status is returned as described in
read(2),
write(2), or
fsync(2). On failure,
aio_error() returns -1 and sets
errno to indicate the error condition.