ioctl_tty.2: srcfix
[man-pages.git] / man3 / aio_error.3
blob441575c45b30bb3180dbdf6322de0b4585b94f50
1 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
8 .\"
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
13 .\"
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 .\" GNU General Public License for more details.
18 .\"
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, see
21 .\" <http://www.gnu.org/licenses/>.
22 .\" %%%LICENSE_END
23 .\"
24 .TH AIO_ERROR 3 2021-03-22  "" "Linux Programmer's Manual"
25 .SH NAME
26 aio_error \- get error status of asynchronous I/O operation
27 .SH SYNOPSIS
28 .nf
29 .B "#include <aio.h>"
30 .PP
31 .BI "int aio_error(const struct aiocb *" aiocbp );
32 .PP
33 Link with \fI\-lrt\fP.
34 .fi
35 .SH DESCRIPTION
36 The
37 .BR aio_error ()
38 function returns the error status for the asynchronous I/O request
39 with control block pointed to by
40 .IR aiocbp .
41 (See
42 .BR aio (7)
43 for a description of the
44 .I aiocb
45 structure.)
46 .SH RETURN VALUE
47 This function returns one of the following:
48 .IP * 3
49 .BR EINPROGRESS ,
50 if the request has not been
51 completed yet.
52 .IP *
53 .BR ECANCELED ,
54 if the request was canceled.
55 .IP *
56 0, if the request completed successfully.
57 .IP *
58 A positive error number, if the asynchronous I/O operation failed.
59 This is the same value that would have been stored in the
60 .I errno
61 variable in the case of a synchronous
62 .BR read (2),
63 .BR write (2),
64 .BR fsync (2),
66 .BR fdatasync (2)
67 call.
68 .SH ERRORS
69 .TP
70 .B EINVAL
71 .I aiocbp
72 does not point at a control block for an asynchronous I/O request
73 of which the return status (see
74 .BR aio_return (3))
75 has not been retrieved yet.
76 .TP
77 .B ENOSYS
78 .BR aio_error ()
79 is not implemented.
80 .SH VERSIONS
81 The
82 .BR aio_error ()
83 function is available since glibc 2.1.
84 .SH ATTRIBUTES
85 For an explanation of the terms used in this section, see
86 .BR attributes (7).
87 .ad l
88 .nh
89 .TS
90 allbox;
91 lbx lb lb
92 l l l.
93 Interface       Attribute       Value
95 .BR aio_error ()
96 T}      Thread safety   MT-Safe
97 .TE
98 .hy
99 .ad
100 .sp 1
101 .SH CONFORMING TO
102 POSIX.1-2001, POSIX.1-2008.
103 .SH EXAMPLES
105 .BR aio (7).
106 .SH SEE ALSO
107 .BR aio_cancel (3),
108 .BR aio_fsync (3),
109 .BR aio_read (3),
110 .BR aio_return (3),
111 .BR aio_suspend (3),
112 .BR aio_write (3),
113 .BR lio_listio (3),
114 .BR aio (7)