mirror of
https://github.com/ziglang/zig.git
synced 2026-02-19 07:48:31 +00:00
parent
0eb3b8fa44
commit
f5f28e0d2c
@ -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;
|
||||
|
||||
@ -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..]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user