/* The aio_error() function shall return 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(), write(),  */
int aio_error(const struct aiocb *cb)
/* The aio_error() function shall return 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(), write(),  */
int aio_error(const struct aiocb *cb)
{
    if (cb)
    {
        return cb->aio_result;
    }
    return -EINVAL;
}