]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright (C) 2003 Free Software Foundation, Inc. |
2297bf0e | 2 | .\" |
fd0fc519 | 3 | .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE) |
fea681da | 4 | .\" This file is distributed according to the GNU General Public License. |
fd0fc519 | 5 | .\" %%%LICENSE_END |
fea681da | 6 | .\" |
4b8c67d9 | 7 | .TH IO_CANCEL 2 2017-09-15 "Linux" "Linux Programmer's Manual" |
fea681da | 8 | .SH NAME |
d12c1424 | 9 | io_cancel \- cancel an outstanding asynchronous I/O operation |
47297adb | 10 | .SH SYNOPSIS |
d12c1424 | 11 | .nf |
e1c5ebfa | 12 | .BR "#include <linux/aio_abi.h>" " /* Defines needed types */" |
dbfe9c70 | 13 | .PP |
c6364a1b | 14 | .BI "int io_cancel(io_context_t " ctx_id ", struct iocb *" iocb , |
d12c1424 | 15 | .BI " struct io_event *" result ); |
d12c1424 | 16 | .fi |
dbfe9c70 | 17 | .PP |
45c99e3e MK |
18 | .IR Note : |
19 | There is no glibc wrapper for this system call; see NOTES. | |
47297adb | 20 | .SH DESCRIPTION |
fea681da | 21 | .PP |
e1c5ebfa | 22 | The |
60a90ecd | 23 | .BR io_cancel () |
e1c5ebfa | 24 | system call |
32792f35 MK |
25 | attempts to cancel an asynchronous I/O operation previously submitted with |
26 | .BR io_submit (2). | |
e1c5ebfa | 27 | The |
2c28d337 MK |
28 | .I iocb |
29 | argument describes the operation to be canceled and the | |
e1c5ebfa | 30 | .I ctx_id |
2c28d337 | 31 | argument is the AIO context to which the operation was submitted. |
9f621816 JM |
32 | If the operation is successfully canceled, the event will be copied into |
33 | the memory pointed to by | |
34 | .I result | |
35 | without being placed into the | |
36 | completion queue. | |
47297adb | 37 | .SH RETURN VALUE |
24d2f49a | 38 | On success, |
60a90ecd | 39 | .BR io_cancel () |
24d2f49a MK |
40 | returns 0. |
41 | For the failure return, see NOTES. | |
47297adb | 42 | .SH ERRORS |
fea681da | 43 | .TP |
c4e45390 MK |
44 | .B EAGAIN |
45 | The \fIiocb\fP specified was not canceled. | |
fea681da | 46 | .TP |
d12c1424 | 47 | .B EFAULT |
fea681da | 48 | One of the data structures points to invalid data. |
fea681da | 49 | .TP |
c4e45390 MK |
50 | .B EINVAL |
51 | The AIO context specified by \fIctx_id\fP is invalid. | |
fea681da | 52 | .TP |
d12c1424 | 53 | .B ENOSYS |
60a90ecd MK |
54 | .BR io_cancel () |
55 | is not implemented on this architecture. | |
47297adb | 56 | .SH VERSIONS |
fea681da | 57 | .PP |
e1c5ebfa | 58 | The asynchronous I/O system calls first appeared in Linux 2.5. |
47297adb | 59 | .SH CONFORMING TO |
fea681da | 60 | .PP |
60a90ecd | 61 | .BR io_cancel () |
8382f16d | 62 | is Linux-specific and should not be used |
35478399 | 63 | in programs that are intended to be portable. |
24d2f49a MK |
64 | .SH NOTES |
65 | Glibc does not provide a wrapper function for this system call. | |
e1c5ebfa MK |
66 | You could invoke it using |
67 | .BR syscall (2). | |
68 | But instead, you probably want to use the | |
69 | .BR io_cancel () | |
70 | wrapper function provided by | |
71 | .\" http://git.fedorahosted.org/git/?p=libaio.git | |
72 | .IR libaio . | |
efeece04 | 73 | .PP |
e1c5ebfa | 74 | Note that the |
24d2f49a | 75 | .I libaio |
e1c5ebfa MK |
76 | wrapper function uses a different type |
77 | .RI ( io_context_t ) | |
78 | .\" But glibc is confused, since <libaio.h> uses 'io_context_t' to declare | |
79 | .\" the system call. | |
80 | for the | |
81 | .I ctx_id | |
82 | argument. | |
83 | Note also that the | |
84 | .I libaio | |
85 | wrapper does not follow the usual C library conventions for indicating errors: | |
24d2f49a MK |
86 | on error it returns a negated error number |
87 | (the negative of one of the values listed in ERRORS). | |
88 | If the system call is invoked via | |
89 | .BR syscall (2), | |
90 | then the return value follows the usual conventions for | |
91 | indicating an error: \-1, with | |
92 | .I errno | |
93 | set to a (positive) value that indicates the error. | |
47297adb | 94 | .SH SEE ALSO |
60a90ecd MK |
95 | .BR io_destroy (2), |
96 | .BR io_getevents (2), | |
c4e45390 | 97 | .BR io_setup (2), |
ff0c3278 MK |
98 | .BR io_submit (2), |
99 | .BR aio (7) | |
d12c1424 MK |
100 | .\" .SH AUTHOR |
101 | .\" Kent Yoder. |