| 1 |
'\" t |
| 2 |
.\" Copyright 2003, Andries E. Brouwer <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
.\" |
| 7 |
.TH aio_error 3 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
aio_error \- get error status of asynchronous I/O operation |
| 10 |
.SH LIBRARY |
| 11 |
Real-time library |
| 12 |
.RI ( librt ,\~ \-lrt ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.B "#include <aio.h>" |
| 16 |
.P |
| 17 |
.BI "int aio_error(const struct aiocb *" aiocbp ); |
| 18 |
.fi |
| 19 |
.SH DESCRIPTION |
| 20 |
The |
| 21 |
.BR aio_error () |
| 22 |
function returns the error status for the asynchronous I/O request |
| 23 |
with control block pointed to by |
| 24 |
.IR aiocbp . |
| 25 |
(See |
| 26 |
.BR aio (7) |
| 27 |
for a description of the |
| 28 |
.I aiocb |
| 29 |
structure.) |
| 30 |
.SH RETURN VALUE |
| 31 |
This function returns one of the following: |
| 32 |
.TP |
| 33 |
.B EINPROGRESS |
| 34 |
if the request has not been |
| 35 |
completed yet. |
| 36 |
.TP |
| 37 |
.B ECANCELED |
| 38 |
if the request was canceled. |
| 39 |
.TP |
| 40 |
.B 0 |
| 41 |
if the request completed successfully. |
| 42 |
.TP |
| 43 |
.RB "> " 0 |
| 44 |
A positive error number, if the asynchronous I/O operation failed. |
| 45 |
This is the same value that would have been stored in the |
| 46 |
.I errno |
| 47 |
variable in the case of a synchronous |
| 48 |
.BR read (2), |
| 49 |
.BR write (2), |
| 50 |
.BR fsync (2), |
| 51 |
or |
| 52 |
.BR fdatasync (2) |
| 53 |
call. |
| 54 |
.SH ERRORS |
| 55 |
.TP |
| 56 |
.B EINVAL |
| 57 |
.I aiocbp |
| 58 |
does not point at a control block for an asynchronous I/O request |
| 59 |
of which the return status (see |
| 60 |
.BR aio_return (3)) |
| 61 |
has not been retrieved yet. |
| 62 |
.TP |
| 63 |
.B ENOSYS |
| 64 |
.BR aio_error () |
| 65 |
is not implemented. |
| 66 |
.SH ATTRIBUTES |
| 67 |
For an explanation of the terms used in this section, see |
| 68 |
.BR attributes (7). |
| 69 |
.TS |
| 70 |
allbox; |
| 71 |
lbx lb lb |
| 72 |
l l l. |
| 73 |
Interface Attribute Value |
| 74 |
T{ |
| 75 |
.na |
| 76 |
.nh |
| 77 |
.BR aio_error () |
| 78 |
T} Thread safety MT-Safe |
| 79 |
.TE |
| 80 |
.SH STANDARDS |
| 81 |
POSIX.1-2008. |
| 82 |
.SH HISTORY |
| 83 |
glibc 2.1. |
| 84 |
POSIX.1-2001. |
| 85 |
.SH EXAMPLES |
| 86 |
See |
| 87 |
.BR aio (7). |
| 88 |
.SH SEE ALSO |
| 89 |
.BR aio_cancel (3), |
| 90 |
.BR aio_fsync (3), |
| 91 |
.BR aio_read (3), |
| 92 |
.BR aio_return (3), |
| 93 |
.BR aio_suspend (3), |
| 94 |
.BR aio_write (3), |
| 95 |
.BR lio_listio (3), |
| 96 |
.BR aio (7) |