From 704660c81a3e53713645528e658881283af013dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Anic=CC=81?= Date: Sun, 31 Mar 2024 23:52:46 +0200 Subject: [PATCH] io_uring: fix copy_cqes logic --- lib/std/os/linux/IoUring.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/os/linux/IoUring.zig b/lib/std/os/linux/IoUring.zig index 7c8eeae7b2..08855fa72f 100644 --- a/lib/std/os/linux/IoUring.zig +++ b/lib/std/os/linux/IoUring.zig @@ -284,7 +284,7 @@ fn copy_cqes_ready(self: *IoUring, cqes: []linux.io_uring_cqe) u32 { const head = self.cq.head.* & self.cq.mask; const tail = (self.cq.head.* +% count) & self.cq.mask; - if (head <= tail) { + if (head < tail) { // head behind tail -> no wrapping @memcpy(cqes[0..count], self.cq.cqes[head..tail]); } else {