Node:Cancel AIO Operations, Next:Configuration of AIO, Previous:Synchronizing AIO Operations, Up:Asynchronous I/O
When one or more requests are asynchronously processed, it might be useful in some situations to cancel a selected operation, e.g., if it becomes obvious that the written data is no longer accurate and would have to be overwritten soon. As an example, assume an application, which writes data in files in a situation where new incoming data would have to be written in a file which will be updated by an enqueued request. The POSIX AIO implementation provides such a function, but this function is not capable of forcing the cancellation of the request. It is up to the implementation to decide whether it is possible to cancel the operation or not. Therefore using this function is merely a hint.
int aio_cancel (int fildes, struct aiocb *aiocbp) | Function |
The aio_cancel function can be used to cancel one or more
outstanding requests. If the aiocbp parameter is NULL , the
function tries to cancel all of the outstanding requests which would process
the file descriptor fildes (i.e., whose aio_fildes member
is fildes). If aiocbp is not NULL , aio_cancel
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
on the After a request is successfully canceled, a call to The return value of the function is If an error occurred during the execution of
When the sources are compiled with |
int aio_cancel64 (int fildes, struct aiocb64 *aiocbp) | Function |
This function is similar to aio_cancel with the only difference
that the argument is a reference to a variable of type struct
aiocb64 .
When the sources are compiled with |