aio_cancel function can be used to cancel one or more
outstanding requests. If the aiocbp parameter is
function tries to cancel all of the outstanding requests which would process
the file descriptor fildes (i.e., whose
is fildes). If aiocbp is not
attempts to cancel the specific request pointed to by aiocbp.
For requests which were successfully canceled, the normal notification
about the termination of the request should take place. I.e., depending
struct sigevent object which controls this, nothing
happens, a signal is sent or a thread is started. If the request cannot
be canceled, it terminates the usual way after performing the operation.
After a request is successfully canceled, a call to
a reference to this request as the parameter will return
ECANCELED and a call to
aio_return will return -1.
If the request wasn't canceled and is still running the error status is
The return value of the function is
AIO_CANCELED if there were
requests which haven't terminated and which were successfully canceled.
If there is one or more requests left which couldn't be canceled, the
return value is
AIO_NOTCANCELED. In this case
must be used to find out which of the, perhaps multiple, requests (in
NULL) weren't successfully canceled. If all
requests already terminated at the time
aio_cancel is called the
return value is
If an error occurred during the execution of
function returns -1 and sets
errno to one of the following
- The file descriptor fildes is not valid.
aio_cancel is not implemented.
When the sources are compiled with
_FILE_OFFSET_BITS == 64, this
function is in fact
aio_cancel64 since the LFS interface
transparently replaces the normal implementation.