Cancels outstanding asynchronous I/O requests for the file descriptor
- File descriptor
- Pointer to control block from where asynchronous I/O request is generated
aio_cancel()function cancels outstanding asynchronous I/O requests for the file descriptor
aiocbpis NULL, all outstanding asynchronous I/O requests are cancelled. If
aiocbpis not NULL, only the requests described by the control block pointed to by
Normal asynchronous notification occurs for cancelled requests. The request return status is set to -1, and the request error status is set to ECANCELED. The control block of requests that cannot be cancelled is not changed.
Unspecified results occur if
aiocbpis not NULL and the
fddiffers from the file descriptor with which the asynchronous operation was initiated.
AIO_CANCELLED: When all specified requests are cancellled successfully.
AIO_NOTCANCELLED: When at least one of the specified requests is still in process of being cancelled; check the status of request using
AIO_ALLDONE: When all specified requests were completed before cancel call was placed.
-1: When some error occurs. To get the correct error code, use