1AIO_CANCEL(3) Linux Programmer's Manual AIO_CANCEL(3)
2
3
4
6 aio_cancel - cancel an outstanding asynchronous I/O request
7
9 #include <aio.h>
10
11 int aio_cancel(int fd, struct aiocb *aiocbp);
12
13 Link with -lrt.
14
16 The aio_cancel() function attempts to cancel outstanding asynchronous
17 I/O requests for the file descriptor fd. If aiocbp is NULL, all such
18 requests are canceled. Otherwise, only the request described by the
19 control block pointed to by aiocbp is canceled. (See aio(7) for a de‐
20 scription of the aiocb structure.)
21
22 Normal asynchronous notification occurs for canceled requests (see
23 aio(7) and sigevent(7)). The request return status (aio_return(3)) is
24 set to -1, and the request error status (aio_error(3)) is set to ECAN‐
25 CELED. The control block of requests that cannot be canceled is not
26 changed.
27
28 If the request could not be canceled, then it will terminate in the
29 usual way after performing the I/O operation. (In this case, aio_er‐
30 ror(3) will return the status EINPROGRESSS.)
31
32 If aiocbp is not NULL, and fd differs from the file descriptor with
33 which the asynchronous operation was initiated, unspecified results oc‐
34 cur.
35
36 Which operations are cancelable is implementation-defined.
37
39 The aio_cancel() function returns one of the following values:
40
41 AIO_CANCELED
42 All requests were successfully canceled.
43
44 AIO_NOTCANCELED
45 At least one of the requests specified was not canceled because
46 it was in progress. In this case, one may check the status of
47 individual requests using aio_error(3).
48
49 AIO_ALLDONE
50 All requests had already been completed before the call.
51
52 -1 An error occurred. The cause of the error can be found by in‐
53 specting errno.
54
56 EBADF fd is not a valid file descriptor.
57
58 ENOSYS aio_cancel() is not implemented.
59
61 The aio_cancel() function is available since glibc 2.1.
62
64 For an explanation of the terms used in this section, see at‐
65 tributes(7).
66
67 ┌────────────────────────────────────────────┬───────────────┬─────────┐
68 │Interface │ Attribute │ Value │
69 ├────────────────────────────────────────────┼───────────────┼─────────┤
70 │aio_cancel() │ Thread safety │ MT-Safe │
71 └────────────────────────────────────────────┴───────────────┴─────────┘
72
74 POSIX.1-2001, POSIX.1-2008.
75
77 See aio(7).
78
80 aio_error(3), aio_fsync(3), aio_read(3), aio_return(3), aio_suspend(3),
81 aio_write(3), lio_listio(3), aio(7)
82
84 This page is part of release 5.13 of the Linux man-pages project. A
85 description of the project, information about reporting bugs, and the
86 latest version of this page, can be found at
87 https://www.kernel.org/doc/man-pages/.
88
89
90
91 2021-03-22 AIO_CANCEL(3)