Commit 45b62c4529
Changed files (1)
lib
std
os
linux
lib/std/os/linux/IoUring.zig
@@ -3503,10 +3503,6 @@ test "accept multishot" {
}
test "accept/connect/send_zc/recv" {
- if (true) {
- // https://github.com/ziglang/zig/issues/20212
- return error.SkipZigTest;
- }
try skipKernelLessThan(.{ .major = 6, .minor = 0, .patch = 0 });
var ring = IoUring.init(16, 0) catch |err| switch (err) {
@@ -3528,25 +3524,28 @@ test "accept/connect/send_zc/recv" {
_ = try ring.recv(0xffffffff, socket_test_harness.server, .{ .buffer = buffer_recv[0..] }, 0);
try testing.expectEqual(@as(u32, 2), try ring.submit());
+ var cqe_send, const cqe_recv = brk: {
+ const cqe1 = try ring.copy_cqe();
+ const cqe2 = try ring.copy_cqe();
+ break :brk if (cqe1.user_data == 0xeeeeeeee) .{ cqe1, cqe2 } else .{ cqe2, cqe1 };
+ };
+
// First completion of zero-copy send.
// IORING_CQE_F_MORE, means that there
// will be a second completion event / notification for the
// request, with the user_data field set to the same value.
// buffer_send must be keep alive until second cqe.
- var cqe_send = try ring.copy_cqe();
try testing.expectEqual(linux.io_uring_cqe{
.user_data = 0xeeeeeeee,
.res = buffer_send.len,
.flags = linux.IORING_CQE_F_MORE,
}, cqe_send);
- const cqe_recv = try ring.copy_cqe();
try testing.expectEqual(linux.io_uring_cqe{
.user_data = 0xffffffff,
.res = buffer_recv.len,
.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..]);
// Second completion of zero-copy send.