Debian Codegraph @

upstream/mageia-cauldron/man2/io_cancel.2

raw
1 .\" Copyright 2003, Free Software Foundation, Inc.
2 .\" Copyright, the authors of the Linux man-pages project
3 .\"
4 .\" SPDX-License-Identifier: GPL-1.0-or-later
5 .\"
6 .TH io_cancel 2 2025-05-17 "Linux man-pages 6.17"
7 .SH NAME
8 io_cancel \- cancel an outstanding asynchronous I/O operation
9 .SH LIBRARY
10 Standard C library
11 .RI ( libc ,\~ \-lc )
12 .P
13 Alternatively, Asynchronous I/O library
14 .RI ( libaio ,\~ \-laio );
15 see VERSIONS.
16 .SH SYNOPSIS
17 .nf
18 .BR "#include <linux/aio_abi.h>" " /* Definition of needed types */"
19 .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
20 .B #include <unistd.h>
21 .P
22 .BI "int syscall(SYS_io_cancel, aio_context_t " ctx_id ", struct iocb *" iocb ,
23 .BI " struct io_event *" result );
24 .fi
25 .SH DESCRIPTION
26 .IR Note :
27 this page describes the raw Linux system call interface.
28 The wrapper function provided by
29 .I libaio
30 uses a different type for the
31 .I ctx_id
32 argument.
33 See VERSIONS.
34 .P
35 The
36 .BR io_cancel ()
37 system call
38 attempts to cancel an asynchronous I/O operation previously submitted with
39 .BR io_submit (2).
40 The
41 .I iocb
42 argument describes the operation to be canceled and the
43 .I ctx_id
44 argument is the AIO context to which the operation was submitted.
45 If the operation is successfully canceled, the event will be copied into
46 the memory pointed to by
47 .I result
48 without being placed into the
49 completion queue.
50 .SH RETURN VALUE
51 On success,
52 .BR io_cancel ()
53 returns 0.
54 For the failure return, see VERSIONS.
55 .SH ERRORS
56 .TP
57 .B EAGAIN
58 The
59 .I iocb
60 specified was not canceled.
61 .TP
62 .B EFAULT
63 One of the data structures points to invalid data.
64 .TP
65 .B EINVAL
66 The AIO context specified by
67 .I ctx_id
68 is invalid.
69 .TP
70 .B ENOSYS
71 .BR io_cancel ()
72 is not implemented on this architecture.
73 .SH VERSIONS
74 You probably want to use the
75 .BR io_cancel ()
76 wrapper function provided by
77 .\" http://git.fedorahosted.org/git/?p=libaio.git
78 .IR libaio .
79 .P
80 Note that the
81 .I libaio
82 wrapper function uses a different type
83 .RI ( io_context_t )
84 .\" But glibc is confused, since <libaio.h> uses 'io_context_t' to declare
85 .\" the system call.
86 for the
87 .I ctx_id
88 argument.
89 Note also that the
90 .I libaio
91 wrapper does not follow the usual C library conventions for indicating errors:
92 on error it returns a negated error number
93 (the negative of one of the values listed in ERRORS).
94 If the system call is invoked via
95 .BR syscall (2),
96 then the return value follows the usual conventions for
97 indicating an error: \-1, with
98 .I errno
99 set to a (positive) value that indicates the error.
100 .SH STANDARDS
101 Linux.
102 .SH HISTORY
103 Linux 2.5.
104 .SH SEE ALSO
105 .BR io_destroy (2),
106 .BR io_getevents (2),
107 .BR io_setup (2),
108 .BR io_submit (2),
109 .BR aio (7)
110 .\" .SH AUTHOR
111 .\" Kent Yoder.