Skip to content

Commit

Permalink
Expose AsyncCancel flags
Browse files Browse the repository at this point in the history
  • Loading branch information
ollie-etl committed Sep 28, 2023
1 parent 4f09464 commit 4a4d662
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/opcode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down

0 comments on commit 4a4d662

Please sign in to comment.