| ... | @@ -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()); |
| 1096 | | 1096 | |
| 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); |