1IO_CANCEL(2) Linux Programmer's Manual IO_CANCEL(2)
2
3
4
6 io_cancel - cancel an outstanding asynchronous I/O operation
7
9 #include <linux/aio_abi.h> /* Definition of needed types */
10 #include <sys/syscall.h> /* Definition of SYS_* constants */
11 #include <unistd.h>
12
13 int syscall(SYS_io_cancel, aio_context_t ctx_id, struct iocb *iocb,
14 struct io_event *result);
15
17 Note: this page describes the raw Linux system call interface. The
18 wrapper function provided by libaio uses a different type for the
19 ctx_id argument. See NOTES.
20
21 The io_cancel() system call attempts to cancel an asynchronous I/O op‐
22 eration previously submitted with io_submit(2). The iocb argument de‐
23 scribes the operation to be canceled and the ctx_id argument is the AIO
24 context to which the operation was submitted. If the operation is suc‐
25 cessfully canceled, the event will be copied into the memory pointed to
26 by result without being placed into the completion queue.
27
29 On success, io_cancel() returns 0. For the failure return, see NOTES.
30
32 EAGAIN The iocb specified was not canceled.
33
34 EFAULT One of the data structures points to invalid data.
35
36 EINVAL The AIO context specified by ctx_id is invalid.
37
38 ENOSYS io_cancel() is not implemented on this architecture.
39
41 The asynchronous I/O system calls first appeared in Linux 2.5.
42
44 io_cancel() is Linux-specific and should not be used in programs that
45 are intended to be portable.
46
48 You probably want to use the io_cancel() wrapper function provided by
49 libaio.
50
51 Note that the libaio wrapper function uses a different type (io_con‐
52 text_t) for the ctx_id argument. Note also that the libaio wrapper
53 does not follow the usual C library conventions for indicating errors:
54 on error it returns a negated error number (the negative of one of the
55 values listed in ERRORS). If the system call is invoked via
56 syscall(2), then the return value follows the usual conventions for in‐
57 dicating an error: -1, with errno set to a (positive) value that indi‐
58 cates the error.
59
61 io_destroy(2), io_getevents(2), io_setup(2), io_submit(2), aio(7)
62
64 This page is part of release 5.13 of the Linux man-pages project. A
65 description of the project, information about reporting bugs, and the
66 latest version of this page, can be found at
67 https://www.kernel.org/doc/man-pages/.
68
69
70
71Linux 2021-03-22 IO_CANCEL(2)