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> /* Defines needed types */
10
11 int io_cancel(aio_context_t ctx_id, struct iocb *iocb,
12 struct io_event *result);
13
14 Note: There is no glibc wrapper for this system call; see NOTES.
15
17 The io_cancel() system call attempts to cancel an asynchronous I/O
18 operation previously submitted with io_submit(2). The iocb argument
19 describes the operation to be canceled and the ctx_id argument is the
20 AIO context to which the operation was submitted. If the operation is
21 successfully canceled, the event will be copied into the memory pointed
22 to by result without being placed into the completion queue.
23
25 On success, io_cancel() returns 0. For the failure return, see NOTES.
26
28 EAGAIN The iocb specified was not canceled.
29
30 EFAULT One of the data structures points to invalid data.
31
32 EINVAL The AIO context specified by ctx_id is invalid.
33
34 ENOSYS io_cancel() is not implemented on this architecture.
35
37 The asynchronous I/O system calls first appeared in Linux 2.5.
38
40 io_cancel() is Linux-specific and should not be used in programs that
41 are intended to be portable.
42
44 Glibc does not provide a wrapper function for this system call. You
45 could invoke it using syscall(2). But instead, you probably want to
46 use the io_cancel() wrapper function provided by libaio.
47
48 Note that the libaio wrapper function uses a different type (io_con‐
49 text_t) for the ctx_id argument. Note also that the libaio wrapper
50 does not follow the usual C library conventions for indicating errors:
51 on error it returns a negated error number (the negative of one of the
52 values listed in ERRORS). If the system call is invoked via
53 syscall(2), then the return value follows the usual conventions for
54 indicating an error: -1, with errno set to a (positive) value that
55 indicates the error.
56
58 io_destroy(2), io_getevents(2), io_setup(2), io_submit(2), aio(7)
59
61 This page is part of release 5.04 of the Linux man-pages project. A
62 description of the project, information about reporting bugs, and the
63 latest version of this page, can be found at
64 https://www.kernel.org/doc/man-pages/.
65
66
67
68Linux 2017-09-15 IO_CANCEL(2)