use io_ring::{io_uring_sqe, io_uring_user_data, IoRing, IoringOp}; #[test] fn nop() { let mut ring = IoRing::new(1).unwrap(); unsafe { let mut sqe = core::mem::zeroed::(); sqe.opcode = IoringOp::Nop; sqe.fd = -1; sqe.user_data = io_uring_user_data::from_u64(114514); ring.push(sqe).unwrap(); } let cqe = ring .submit_and_wait(core::time::Duration::from_secs(1)) .unwrap(); assert_eq!(cqe.res, 0); assert_eq!(cqe.user_data.u64_(), 114514); }