diff --git a/src/opcode.rs b/src/opcode.rs index 6e6f73f5..2df81885 100644 --- a/src/opcode.rs +++ b/src/opcode.rs @@ -650,21 +650,21 @@ opcode! { opcode! { /// Attempt to cancel an already issued request. pub struct AsyncCancel { - user_data: { u64 } + user_data: { u64 }, + flags: { types::AsyncCancelFlags }, ;; - - // TODO flags } pub const CODE = sys::IORING_OP_ASYNC_CANCEL; pub fn build(self) -> Entry { - let AsyncCancel { user_data } = self; + let AsyncCancel { user_data, flags } = self; let mut sqe = sqe_zeroed(); sqe.opcode = Self::CODE; sqe.fd = -1; sqe.__bindgen_anon_2.addr = user_data; + sqe.__bindgen_anon_3.cancel_flags = flags.bits(); Entry(sqe) } } diff --git a/src/types.rs b/src/types.rs index db3bdcef..104c79e0 100644 --- a/src/types.rs +++ b/src/types.rs @@ -108,7 +108,7 @@ bitflags! { bitflags! { /// Options for [`AsyncCancel`](super::AsyncCancel) and /// [`Submitter::register_sync_cancel`](super::Submitter::register_sync_cancel). - pub(crate) struct AsyncCancelFlags: u32 { + pub struct AsyncCancelFlags: u32 { /// Cancel all requests that match the given criteria, rather /// than just canceling the first one found. ///