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

NAME

6       aio_cancel - cancel an outstanding asynchronous I/O request
7

SYNOPSIS

9       #include <aio.h>
10
11       int aio_cancel(int fd, struct aiocb *aiocbp);
12
13       Link with -lrt.
14

DESCRIPTION

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

RETURN VALUE

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

ERRORS

56       EBADF  fd is not a valid file descriptor.
57
58       ENOSYS aio_cancel() is not implemented.
59

VERSIONS

61       The aio_cancel() function is available since glibc 2.1.
62

ATTRIBUTES

64       For  an  explanation  of  the  terms  used   in   this   section,   see
65       attributes(7).
66
67       ┌─────────────┬───────────────┬─────────┐
68Interface    Attribute     Value   
69       ├─────────────┼───────────────┼─────────┤
70aio_cancel() │ Thread safety │ MT-Safe │
71       └─────────────┴───────────────┴─────────┘

CONFORMING TO

73       POSIX.1-2001, POSIX.1-2008.
74

EXAMPLE

76       See aio(7).
77

SEE ALSO

79       aio_error(3), aio_fsync(3), aio_read(3), aio_return(3), aio_suspend(3),
80       aio_write(3), lio_listio(3), aio(7)
81

COLOPHON

83       This page is part of release 4.15 of the Linux  man-pages  project.   A
84       description  of  the project, information about reporting bugs, and the
85       latest    version    of    this    page,    can     be     found     at
86       https://www.kernel.org/doc/man-pages/.
87
88
89
90                                  2015-03-02                     AIO_CANCEL(3)
Impressum