1IO_CANCEL(2)               Linux Programmer's Manual              IO_CANCEL(2)
2
3
4

NAME

6       io_cancel - cancel an outstanding asynchronous I/O operation
7

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

29       On success, io_cancel() returns 0.  For the failure return, see NOTES.
30

ERRORS

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

VERSIONS

41       The asynchronous I/O system calls first appeared in Linux 2.5.
42

CONFORMING TO

44       io_cancel() is Linux-specific and should not be used in  programs  that
45       are intended to be portable.
46

NOTES

48       Glibc  does  not  provide a wrapper function for this system call.  You
49       could invoke it using syscall(2).  But instead, you  probably  want  to
50       use the io_cancel() wrapper function provided by libaio.
51
52       Note  that  the  libaio wrapper function uses a different type (io_con‐
53       text_t) for the ctx_id argument.  Note also  that  the  libaio  wrapper
54       does  not follow the usual C library conventions for indicating errors:
55       on error it returns a negated error number (the negative of one of  the
56       values   listed  in  ERRORS).   If  the  system  call  is  invoked  via
57       syscall(2), then the return value follows the usual conventions for in‐
58       dicating  an error: -1, with errno set to a (positive) value that indi‐
59       cates the error.
60

SEE ALSO

62       io_destroy(2), io_getevents(2), io_setup(2), io_submit(2), aio(7)
63

COLOPHON

65       This page is part of release 5.10 of the Linux  man-pages  project.   A
66       description  of  the project, information about reporting bugs, and the
67       latest    version    of    this    page,    can     be     found     at
68       https://www.kernel.org/doc/man-pages/.
69
70
71
72Linux                             2020-12-21                      IO_CANCEL(2)
Impressum