diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index 1ed177c86b..9d7980320b 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -3761,6 +3761,8 @@ pub const IORING_CQE_F_BUFFER = 1 << 0; pub const IORING_CQE_F_MORE = 1 << 1; /// If set, more data to read after socket recv pub const IORING_CQE_F_SOCK_NONEMPTY = 1 << 2; +/// Set for notification CQEs. Can be used to distinct them from sends. +pub const IORING_CQE_F_NOTIF = 1 << 3; /// Magic offsets for the application to mmap the data it needs pub const IORING_OFF_SQ_RING = 0; diff --git a/lib/std/os/linux/io_uring.zig b/lib/std/os/linux/io_uring.zig index 01fd7fa84b..3bc3fbaf7b 100644 --- a/lib/std/os/linux/io_uring.zig +++ b/lib/std/os/linux/io_uring.zig @@ -2007,7 +2007,8 @@ test "accept/connect/send/recv" { try testing.expectEqual(linux.io_uring_cqe{ .user_data = 0xffffffff, .res = buffer_recv.len, - .flags = 0, + // ignore IORING_CQE_F_SOCK_NONEMPTY since it is only set on some systems + .flags = cqe_recv.flags & linux.IORING_CQE_F_SOCK_NONEMPTY, }, cqe_recv); try testing.expectEqualSlices(u8, buffer_send[0..buffer_recv.len], buffer_recv[0..]); @@ -2089,7 +2090,8 @@ test "sendmsg/recvmsg" { try testing.expectEqual(linux.io_uring_cqe{ .user_data = 0x22222222, .res = buffer_recv.len, - .flags = 0, + // ignore IORING_CQE_F_SOCK_NONEMPTY since it is set non-deterministically + .flags = cqe_recvmsg.flags & linux.IORING_CQE_F_SOCK_NONEMPTY, }, cqe_recvmsg); try testing.expectEqualSlices(u8, buffer_send[0..buffer_recv.len], buffer_recv[0..]);