prepCancel

Prepares operation that cancels existing async work.

This works with any read/write request, accept,send/recvmsg, etc. There’s an important distinction to make here with the different kinds of commands. A read/write on a regular file will generally be waiting for IO completion in an uninterruptible state. This means it’ll ignore any signals or attempts to cancel it, as these operations are uncancellable. io_uring can cancel these operations if they haven’t yet been started. If they have been started, cancellations on these will fail. Network IO will generally be waiting interruptibly, and can hence be cancelled at any time. The completion event for this request will have a result of 0 if done successfully, -EALREADY if the operation is already in progress, and -ENOENT if the original request specified cannot be found. For cancellation requests that return -EALREADY, io_uring may or may not cause this request to be stopped sooner. For blocking IO, the original request will complete as it originally would have. For IO that is cancellable, it will terminate sooner if at all possible.

nothrow @nogc ref @trusted
SubmissionEntry
prepCancel
(
D
)
(
return ref SubmissionEntry entry
,
ref D userData
,
uint flags = 0
)

Parameters

entry SubmissionEntry

SubmissionEntry to prepare

userData D

user_data field of the request that should be cancelled

Note: Available from Linux 5.5

Meta