Using aiocancel()

This command routine attempts to cancel the asynchronous request whose aio_result_t structure is given as an argument. An aiocancel() call succeeds only if the request is still queued. If the operation is in progress, aiocancel() fails.