1aio_cancel(3)              Library Functions Manual              aio_cancel(3)
2
3
4

NAME

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

LIBRARY

9       Real-time library (librt, -lrt)
10

SYNOPSIS

12       #include <aio.h>
13
14       int aio_cancel(int fd, struct aiocb *aiocbp);
15

DESCRIPTION

17       The  aio_cancel()  function attempts to cancel outstanding asynchronous
18       I/O requests for the file descriptor fd.  If aiocbp is NULL,  all  such
19       requests  are  canceled.   Otherwise, only the request described by the
20       control block pointed to by aiocbp is canceled.  (See aio(7) for a  de‐
21       scription of the aiocb structure.)
22
23       Normal  asynchronous  notification  occurs  for  canceled requests (see
24       aio(7) and sigevent(7)).  The request return status (aio_return(3))  is
25       set  to -1, and the request error status (aio_error(3)) is set to ECAN‐
26       CELED.  The control block of requests that cannot be  canceled  is  not
27       changed.
28
29       If  the  request  could  not be canceled, then it will terminate in the
30       usual way after performing the I/O operation.  (In this  case,  aio_er‐
31       ror(3) will return the status EINPROGRESSS.)
32
33       If  aiocbp  is  not  NULL, and fd differs from the file descriptor with
34       which the asynchronous operation was initiated, unspecified results oc‐
35       cur.
36
37       Which operations are cancelable is implementation-defined.
38

RETURN VALUE

40       The aio_cancel() function returns one of the following values:
41
42       AIO_CANCELED
43              All requests were successfully canceled.
44
45       AIO_NOTCANCELED
46              At  least one of the requests specified was not canceled because
47              it was in progress.  In this case, one may check the  status  of
48              individual requests using aio_error(3).
49
50       AIO_ALLDONE
51              All requests had already been completed before the call.
52
53       -1     An  error  occurred.  The cause of the error can be found by in‐
54              specting errno.
55

ERRORS

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

ATTRIBUTES

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

STANDARDS

72       POSIX.1-2008.
73

HISTORY

75       glibc 2.1.  POSIX.1-2001.
76

EXAMPLES

78       See aio(7).
79

SEE ALSO

81       aio_error(3), aio_fsync(3), aio_read(3), aio_return(3), aio_suspend(3),
82       aio_write(3), lio_listio(3), aio(7)
83
84
85
86Linux man-pages 6.04              2023-03-30                     aio_cancel(3)
Impressum