1io_cancel(2) System Calls Manual io_cancel(2)
2
3
4
6 io_cancel - cancel an outstanding asynchronous I/O operation
7
9 Standard C library (libc, -lc)
10
11 Alternatively, Asynchronous I/O library (libaio, -laio); see VERSIONS.
12
14 #include <linux/aio_abi.h> /* Definition of needed types */
15 #include <sys/syscall.h> /* Definition of SYS_* constants */
16 #include <unistd.h>
17
18 int syscall(SYS_io_cancel, aio_context_t ctx_id, struct iocb *iocb,
19 struct io_event *result);
20
22 Note: this page describes the raw Linux system call interface. The
23 wrapper function provided by libaio uses a different type for the
24 ctx_id argument. See VERSIONS.
25
26 The io_cancel() system call attempts to cancel an asynchronous I/O op‐
27 eration previously submitted with io_submit(2). The iocb argument de‐
28 scribes the operation to be canceled and the ctx_id argument is the AIO
29 context to which the operation was submitted. If the operation is suc‐
30 cessfully canceled, the event will be copied into the memory pointed to
31 by result without being placed into the completion queue.
32
34 On success, io_cancel() returns 0. For the failure return, see VER‐
35 SIONS.
36
38 EAGAIN The iocb specified was not canceled.
39
40 EFAULT One of the data structures points to invalid data.
41
42 EINVAL The AIO context specified by ctx_id is invalid.
43
44 ENOSYS io_cancel() is not implemented on this architecture.
45
47 You probably want to use the io_cancel() wrapper function provided by
48 libaio.
49
50 Note that the libaio wrapper function uses a different type (io_con‐
51 text_t) for the ctx_id argument. Note also that the libaio wrapper
52 does not follow the usual C library conventions for indicating errors:
53 on error it returns a negated error number (the negative of one of the
54 values listed in ERRORS). If the system call is invoked via
55 syscall(2), then the return value follows the usual conventions for in‐
56 dicating an error: -1, with errno set to a (positive) value that indi‐
57 cates the error.
58
60 Linux.
61
63 Linux 2.5.
64
66 io_destroy(2), io_getevents(2), io_setup(2), io_submit(2), aio(7)
67
68
69
70Linux man-pages 6.05 2023-03-30 io_cancel(2)