authorgravatar for joran@ronomon.comJoran Dirk Greef <joran@ronomon.com> 2020-10-04 16:05:52+02:00
committergravatar for joran@ronomon.comJoran Dirk Greef <joran@ronomon.com> 2020-10-04 16:05:52+02:00
log72bdfa5bdda561e640206082f1deb5f80ebebfa7
tree1ad042cdf92559242e5799cb55b7144bce4c9e15
parent9091fcbe9d9161b12bb2229eb9b30b1b14153a0c

Skip openat test only for older kernels that do not fully support AT_FDCWD


1 files changed, 7 insertions(+), 1 deletions(-)

lib/std/os/linux/io_uring.zig+7-1
...@@ -1095,8 +1095,14 @@ test "openat/close" {...@@ -1095,8 +1095,14 @@ test "openat/close" {
1095 testing.expectEqual(@as(u32, 1), try ring.submit());1095 testing.expectEqual(@as(u32, 1), try ring.submit());
10961096
1097 var cqe_openat = try ring.copy_cqe();1097 var cqe_openat = try ring.copy_cqe();
1098 if (cqe_openat.res == -linux.EINVAL) return error.SkipZigTest;
1099 testing.expectEqual(@as(u64, 789), cqe_openat.user_data);1098 testing.expectEqual(@as(u64, 789), cqe_openat.user_data);
1099 if (cqe_openat.res == -linux.EINVAL) return error.SkipZigTest;
1100 // AT_FDCWD is not fully supported before kernel 5.6:
1101 // See https://lore.kernel.org/io-uring/20200207155039.12819-1-axboe@kernel.dk/T/
1102 // We use IORING_FEAT_RW_CUR_POS to know if we are pre-5.6 since that feature was added in 5.6.
1103 if (cqe_openat.res == -linux.EBADF and (ring.features & linux.IORING_FEAT_RW_CUR_POS) == 0) {
1104 return error.SkipZigTest;
1105 }
1100 if (cqe_openat.res <= 0) std.debug.print("\ncqe_openat.res={}\n", .{ cqe_openat.res });1106 if (cqe_openat.res <= 0) std.debug.print("\ncqe_openat.res={}\n", .{ cqe_openat.res });
1101 testing.expect(cqe_openat.res > 0);1107 testing.expect(cqe_openat.res > 0);
1102 testing.expectEqual(@as(u32, 0), cqe_openat.flags);1108 testing.expectEqual(@as(u32, 0), cqe_openat.flags);