authorgravatar for joran@ronomon.comJoran Dirk Greef <joran@ronomon.com> 2020-09-20 15:33:48+02:00
committergravatar for joran@ronomon.comJoran Dirk Greef <joran@ronomon.com> 2020-09-20 15:33:48+02:00
logf22eea82c4563545844c2f5840e9cc1c9bd31fe0
tree1a44bcebb5b187ff0f1cf05b9757e212b17e92a0
parentb672dc7abfe318623e88afd2e9ccaffbf38eb401

Fix opcode support detection for read/write test


1 files changed, 4 insertions(+), 2 deletions(-)

lib/std/os/linux/io_uring.zig+4-2
...@@ -848,8 +848,10 @@ test "queue_write/queue_read" {...@@ -848,8 +848,10 @@ test "queue_write/queue_read" {
848848
849 var cqe1 = try ring.copy_cqe();849 var cqe1 = try ring.copy_cqe();
850 var cqe2 = try ring.copy_cqe();850 var cqe2 = try ring.copy_cqe();
851 if (cqe1.res == -linux.EOPNOTSUPP) return error.SkipZigTest;851 // Prior to Linux Kernel 5.6 this is the only way to test for read/write support:
852 if (cqe2.res == -linux.EOPNOTSUPP) return error.SkipZigTest;852 // https://lwn.net/Articles/809820/
853 if (cqe1.res == -linux.EINVAL) return error.SkipZigTest;
854 if (cqe2.res == -linux.EINVAL) return error.SkipZigTest;
853 testing.expectEqual(linux.io_uring_cqe {855 testing.expectEqual(linux.io_uring_cqe {
854 .user_data = 123,856 .user_data = 123,
855 .res = buffer_write.len,857 .res = buffer_write.len,