]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) |
2 | .\" | |
3 | .\" This is free documentation; you can redistribute it and/or | |
4 | .\" modify it under the terms of the GNU General Public License as | |
5 | .\" published by the Free Software Foundation; either version 2 of | |
6 | .\" the License, or (at your option) any later version. | |
7 | .\" | |
8 | .\" The GNU General Public License's references to "object code" | |
9 | .\" and "executables" are to be interpreted as the output of any | |
10 | .\" document formatting or typesetting system, including | |
11 | .\" intermediate and printed output. | |
12 | .\" | |
13 | .\" This manual is distributed in the hope that it will be useful, | |
14 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | .\" GNU General Public License for more details. | |
17 | .\" | |
18 | .\" You should have received a copy of the GNU General Public | |
19 | .\" License along with this manual; if not, write to the Free | |
20 | .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, | |
21 | .\" USA. | |
22 | .\" | |
bc8e7b95 | 23 | .TH AIO_CANCEL 3 2012-05-08 "" "Linux Programmer's Manual" |
fea681da MK |
24 | .SH NAME |
25 | aio_cancel \- cancel an outstanding asynchronous I/O request | |
26 | .SH SYNOPSIS | |
fea681da MK |
27 | .B "#include <aio.h>" |
28 | .sp | |
29 | .BI "int aio_cancel(int " fd ", struct aiocb *" aiocbp ); | |
0ad25472 MK |
30 | .sp |
31 | Link with \fI\-lrt\fP. | |
fea681da MK |
32 | .SH DESCRIPTION |
33 | The | |
e511ffb6 | 34 | .BR aio_cancel () |
fea681da MK |
35 | function attempts to cancel outstanding asynchronous I/O requests |
36 | for the file descriptor | |
37 | .IR fd . | |
38 | If | |
39 | .I aiocbp | |
d9bfdb9c | 40 | is NULL, all such requests are canceled. |
c13182ef | 41 | Otherwise, only the request |
fea681da MK |
42 | described by the control block pointed to by |
43 | .I aiocbp | |
d9bfdb9c | 44 | is canceled. |
2b014d76 MK |
45 | (See |
46 | .BR aio (7) | |
47 | for a description of the | |
48 | .I aiocb | |
49 | structure.) | |
fea681da | 50 | .LP |
2da75a9e MK |
51 | Normal asynchronous notification occurs for canceled requests (see |
52 | .BR aio (7) | |
53 | and | |
54 | .BR sigevent (7)). | |
4de52db8 MK |
55 | The request return status |
56 | .RB ( aio_return (3)) | |
57 | is set to \-1, and the request error status | |
58 | .RB ( aio_error (3)) | |
2f0af33b MK |
59 | is set to |
60 | .BR ECANCELED . | |
d9bfdb9c | 61 | The control block of requests that cannot be canceled is not changed. |
fea681da | 62 | .LP |
bc8e7b95 MK |
63 | If the request could not be canceled, |
64 | then it will terminate in the usual way after performing the I/O operation. | |
65 | (In this case, | |
66 | .BR aio_error (3) | |
67 | will return the status | |
68 | .BR EINPROGRESSS .) | |
69 | .LP | |
fea681da MK |
70 | If |
71 | .I aiocbp | |
72 | is not NULL, and | |
73 | .I fd | |
74 | differs from the file descriptor with which the asynchronous operation | |
75 | was initiated, unspecified results occur. | |
76 | .LP | |
4c3fb935 | 77 | Which operations are cancelable is implementation-defined. |
fea681da | 78 | .\" FreeBSD: not those on raw disk devices. |
47297adb | 79 | .SH RETURN VALUE |
fb07934b MK |
80 | The |
81 | .BR aio_cancel () | |
82 | function returns one of the following values: | |
83 | .TP | |
2f0af33b | 84 | .B AIO_CANCELED |
fb07934b MK |
85 | All requests were successfully canceled. |
86 | .TP | |
1274071a | 87 | .B AIO_NOTCANCELED |
fb07934b | 88 | At least one of the |
d9bfdb9c | 89 | requests specified was not canceled because it was in progress. |
fb07934b | 90 | In this case, one may check the status of individual requests using |
fea681da | 91 | .BR aio_error (3). |
fb07934b | 92 | .TP |
2f0af33b | 93 | .B AIO_ALLDONE |
fb07934b MK |
94 | All requests had already been completed before the call. |
95 | .TP | |
96 | \-1 | |
97 | An error occurred. | |
98 | The cause of the error can be found by inspecting | |
99 | .IR errno . | |
fea681da MK |
100 | .SH ERRORS |
101 | .TP | |
102 | .B EBADF | |
103 | .I fd | |
104 | is not a valid file descriptor. | |
aea038d6 MK |
105 | .TP |
106 | .B ENOSYS | |
02ace852 | 107 | .BR aio_cancel () |
aea038d6 | 108 | is not implemented. |
793514ae MK |
109 | .SH VERSIONS |
110 | The | |
111 | .BR aio_cancel () | |
112 | function is available since glibc 2.1. | |
47297adb | 113 | .SH CONFORMING TO |
793514ae | 114 | POSIX.1-2001, POSIX.1-2008. |
b44bee16 MK |
115 | .SH EXAMPLE |
116 | See | |
117 | .BR aio (7). | |
47297adb | 118 | .SH SEE ALSO |
fea681da MK |
119 | .BR aio_error (3), |
120 | .BR aio_fsync (3), | |
121 | .BR aio_read (3), | |
122 | .BR aio_return (3), | |
123 | .BR aio_suspend (3), | |
25fa6c3d | 124 | .BR aio_write (3), |
cd587df6 | 125 | .BR lio_listio (3), |
25fa6c3d | 126 | .BR aio (7) |