pub const io_uring_cqe = extern struct user_data: u64io_uring_sqe.data submission passed back
res: i32result code for this event
flags: u32pub fn err(self: io_uring_cqe) Epub fn buffer_id(self: io_uring_cqe) !u167471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497pub const io_uring_cqe = extern struct {
/// io_uring_sqe.data submission passed back
user_data: u64,
/// result code for this event
res: i32,
flags: u32,
// Followed by 16 bytes of padding if initialized with IORING_SETUP_CQE32, doubling cqe size
pub fn err(self: io_uring_cqe) E {
if (self.res > -4096 and self.res < 0) {
return @as(E, @fromBackingInt(@intCast(-self.res)));
}
return .SUCCESS;
}
// On successful completion of the provided buffers IO request, the CQE flags field
// will have IORING_CQE_F_BUFFER set and the selected buffer ID will be indicated by
// the upper 16-bits of the flags field.
pub fn buffer_id(self: io_uring_cqe) !u16 {
if (self.flags & IORING_CQE_F_BUFFER != IORING_CQE_F_BUFFER) {
return error.NoBufferSelected;
}
return @as(u16, @intCast(self.flags >> IORING_CQE_BUFFER_SHIFT));
}
}