mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
Add IORING_SQ_CQ_OVERFLOW to std/os/bits/linux.zig
This commit is contained in:
parent
21c81360ba
commit
d966fe6319
@ -38,9 +38,6 @@ pub const io_uring_sqe = extern struct {
|
||||
options: [2]u64 = [2]u64{ 0, 0 }
|
||||
};
|
||||
|
||||
// TODO Add to zig/std/os/bits/linux.zig:
|
||||
const IORING_SQ_CQ_OVERFLOW = 1 << 1;
|
||||
|
||||
comptime {
|
||||
assert(@sizeOf(io_uring_params) == 120);
|
||||
assert(@sizeOf(io_uring_sqe) == 64);
|
||||
@ -315,7 +312,7 @@ pub const IO_Uring = struct {
|
||||
|
||||
// Matches the implementation of cq_ring_needs_flush() in liburing.
|
||||
fn cq_ring_needs_flush(self: *IO_Uring) bool {
|
||||
return (@atomicLoad(u32, self.sq.flags, .Unordered) & IORING_SQ_CQ_OVERFLOW) != 0;
|
||||
return (@atomicLoad(u32, self.sq.flags, .Unordered) & linux.IORING_SQ_CQ_OVERFLOW) != 0;
|
||||
}
|
||||
|
||||
/// For advanced use cases only that implement custom completion queue methods.
|
||||
|
||||
@ -1251,6 +1251,9 @@ pub const io_sqring_offsets = extern struct {
|
||||
/// needs io_uring_enter wakeup
|
||||
pub const IORING_SQ_NEED_WAKEUP = 1 << 0;
|
||||
|
||||
/// kernel has cqes waiting beyond the cq ring
|
||||
pub const IORING_SQ_CQ_OVERFLOW = 1 << 1;
|
||||
|
||||
pub const io_cqring_offsets = extern struct {
|
||||
head: u32,
|
||||
tail: u32,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user