]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) |
2 | .\" | |
1dd72f9c | 3 | .\" %%%LICENSE_START(GPLv2+_DOC_FULL) |
fea681da MK |
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 | |
c715f741 MK |
20 | .\" License along with this manual; if not, see |
21 | .\" <http://www.gnu.org/licenses/>. | |
6a8d8745 | 22 | .\" %%%LICENSE_END |
fea681da | 23 | .\" |
fe0fefbf | 24 | .TH AIO_CANCEL 3 2015-03-02 "" "Linux Programmer's Manual" |
fea681da MK |
25 | .SH NAME |
26 | aio_cancel \- cancel an outstanding asynchronous I/O request | |
27 | .SH SYNOPSIS | |
fea681da | 28 | .B "#include <aio.h>" |
68e4db0a | 29 | .PP |
fea681da | 30 | .BI "int aio_cancel(int " fd ", struct aiocb *" aiocbp ); |
68e4db0a | 31 | .PP |
0ad25472 | 32 | Link with \fI\-lrt\fP. |
fea681da MK |
33 | .SH DESCRIPTION |
34 | The | |
e511ffb6 | 35 | .BR aio_cancel () |
fea681da MK |
36 | function attempts to cancel outstanding asynchronous I/O requests |
37 | for the file descriptor | |
38 | .IR fd . | |
39 | If | |
40 | .I aiocbp | |
d9bfdb9c | 41 | is NULL, all such requests are canceled. |
c13182ef | 42 | Otherwise, only the request |
fea681da MK |
43 | described by the control block pointed to by |
44 | .I aiocbp | |
d9bfdb9c | 45 | is canceled. |
2b014d76 MK |
46 | (See |
47 | .BR aio (7) | |
48 | for a description of the | |
49 | .I aiocb | |
50 | structure.) | |
dd3568a1 | 51 | .PP |
2da75a9e MK |
52 | Normal asynchronous notification occurs for canceled requests (see |
53 | .BR aio (7) | |
54 | and | |
55 | .BR sigevent (7)). | |
4de52db8 MK |
56 | The request return status |
57 | .RB ( aio_return (3)) | |
58 | is set to \-1, and the request error status | |
59 | .RB ( aio_error (3)) | |
2f0af33b MK |
60 | is set to |
61 | .BR ECANCELED . | |
d9bfdb9c | 62 | The control block of requests that cannot be canceled is not changed. |
dd3568a1 | 63 | .PP |
bc8e7b95 MK |
64 | If the request could not be canceled, |
65 | then it will terminate in the usual way after performing the I/O operation. | |
66 | (In this case, | |
67 | .BR aio_error (3) | |
68 | will return the status | |
69 | .BR EINPROGRESSS .) | |
dd3568a1 | 70 | .PP |
fea681da MK |
71 | If |
72 | .I aiocbp | |
73 | is not NULL, and | |
74 | .I fd | |
75 | differs from the file descriptor with which the asynchronous operation | |
76 | was initiated, unspecified results occur. | |
dd3568a1 | 77 | .PP |
4c3fb935 | 78 | Which operations are cancelable is implementation-defined. |
fea681da | 79 | .\" FreeBSD: not those on raw disk devices. |
47297adb | 80 | .SH RETURN VALUE |
fb07934b MK |
81 | The |
82 | .BR aio_cancel () | |
83 | function returns one of the following values: | |
84 | .TP | |
2f0af33b | 85 | .B AIO_CANCELED |
fb07934b MK |
86 | All requests were successfully canceled. |
87 | .TP | |
1274071a | 88 | .B AIO_NOTCANCELED |
fb07934b | 89 | At least one of the |
d9bfdb9c | 90 | requests specified was not canceled because it was in progress. |
fb07934b | 91 | In this case, one may check the status of individual requests using |
fea681da | 92 | .BR aio_error (3). |
fb07934b | 93 | .TP |
2f0af33b | 94 | .B AIO_ALLDONE |
fb07934b MK |
95 | All requests had already been completed before the call. |
96 | .TP | |
97 | \-1 | |
98 | An error occurred. | |
99 | The cause of the error can be found by inspecting | |
100 | .IR errno . | |
fea681da MK |
101 | .SH ERRORS |
102 | .TP | |
103 | .B EBADF | |
104 | .I fd | |
105 | is not a valid file descriptor. | |
aea038d6 MK |
106 | .TP |
107 | .B ENOSYS | |
02ace852 | 108 | .BR aio_cancel () |
aea038d6 | 109 | is not implemented. |
793514ae MK |
110 | .SH VERSIONS |
111 | The | |
112 | .BR aio_cancel () | |
113 | function is available since glibc 2.1. | |
18e212e0 MS |
114 | .SH ATTRIBUTES |
115 | For an explanation of the terms used in this section, see | |
116 | .BR attributes (7). | |
117 | .TS | |
118 | allbox; | |
119 | lb lb lb | |
120 | l l l. | |
121 | Interface Attribute Value | |
122 | T{ | |
123 | .BR aio_cancel () | |
124 | T} Thread safety MT-Safe | |
125 | .TE | |
47297adb | 126 | .SH CONFORMING TO |
793514ae | 127 | POSIX.1-2001, POSIX.1-2008. |
b44bee16 MK |
128 | .SH EXAMPLE |
129 | See | |
130 | .BR aio (7). | |
47297adb | 131 | .SH SEE ALSO |
fea681da MK |
132 | .BR aio_error (3), |
133 | .BR aio_fsync (3), | |
134 | .BR aio_read (3), | |
135 | .BR aio_return (3), | |
136 | .BR aio_suspend (3), | |
25fa6c3d | 137 | .BR aio_write (3), |
cd587df6 | 138 | .BR lio_listio (3), |
25fa6c3d | 139 | .BR aio (7) |