Commit 704660c81a

Igor Anić <igor.anic@gmail.com>
2024-03-31 23:52:46
io_uring: fix copy_cqes logic
1 parent 631c28c
Changed files (1)
lib
std
os
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 {