From f22eea82c4563545844c2f5840e9cc1c9bd31fe0 Mon Sep 17 00:00:00 2001 From: Joran Dirk Greef Date: Sun, 20 Sep 2020 15:33:48 +0200 Subject: [PATCH] Fix opcode support detection for read/write test --- lib/std/os/linux/io_uring.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/std/os/linux/io_uring.zig b/lib/std/os/linux/io_uring.zig index 940270316a..d03ccbe2a4 100644 --- a/lib/std/os/linux/io_uring.zig +++ b/lib/std/os/linux/io_uring.zig @@ -848,8 +848,10 @@ test "queue_write/queue_read" { var cqe1 = try ring.copy_cqe(); var cqe2 = try ring.copy_cqe(); - if (cqe1.res == -linux.EOPNOTSUPP) return error.SkipZigTest; - if (cqe2.res == -linux.EOPNOTSUPP) return error.SkipZigTest; + // Prior to Linux Kernel 5.6 this is the only way to test for read/write support: + // https://lwn.net/Articles/809820/ + if (cqe1.res == -linux.EINVAL) return error.SkipZigTest; + if (cqe2.res == -linux.EINVAL) return error.SkipZigTest; testing.expectEqual(linux.io_uring_cqe { .user_data = 123, .res = buffer_write.len,