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
20 description 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,
30 aio_error(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
34 occur.
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
53 inspecting 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 POSIX.1-2001, POSIX.1-2008.
65
67 See aio(7).
68
70 aio_error(3), aio_fsync(3), aio_read(3), aio_return(3), aio_suspend(3),
71 aio_write(3), lio_listio(3), aio(7)
72
74 This page is part of release 3.53 of the Linux man-pages project. A
75 description of the project, and information about reporting bugs, can
76 be found at http://www.kernel.org/doc/man-pages/.
77
78
79
80 2012-05-08 AIO_CANCEL(3)