| ... | ... | @@ -1033,11 +1033,11 @@ test "write/read" { |
| 1033 | 1033 | |
| 1034 | 1034 | const buffer_write = [_]u8{97} ** 20; |
| 1035 | 1035 | var buffer_read = [_]u8{98} ** 20; |
| 1036 | | const sqe_write = try ring.write(123, fd, buffer_write[0..], 10); |
| 1036 | const sqe_write = try ring.write(0x11111111, fd, buffer_write[0..], 10); |
| 1037 | 1037 | testing.expectEqual(linux.IORING_OP.WRITE, sqe_write.opcode); |
| 1038 | 1038 | testing.expectEqual(@as(u64, 10), sqe_write.off); |
| 1039 | 1039 | sqe_write.flags |= linux.IOSQE_IO_LINK; |
| 1040 | | const sqe_read = try ring.read(456, fd, buffer_read[0..], 10); |
| 1040 | const sqe_read = try ring.read(0x22222222, fd, buffer_read[0..], 10); |
| 1041 | 1041 | testing.expectEqual(linux.IORING_OP.READ, sqe_read.opcode); |
| 1042 | 1042 | testing.expectEqual(@as(u64, 10), sqe_read.off); |
| 1043 | 1043 | testing.expectEqual(@as(u32, 2), try ring.submit()); |
| ... | ... | @@ -1049,12 +1049,12 @@ test "write/read" { |
| 1049 | 1049 | if (cqe_write.res == -linux.EINVAL) return error.SkipZigTest; |
| 1050 | 1050 | if (cqe_read.res == -linux.EINVAL) return error.SkipZigTest; |
| 1051 | 1051 | testing.expectEqual(linux.io_uring_cqe { |
| 1052 | | .user_data = 123, |
| 1052 | .user_data = 0x11111111, |
| 1053 | 1053 | .res = buffer_write.len, |
| 1054 | 1054 | .flags = 0, |
| 1055 | 1055 | }, cqe_write); |
| 1056 | 1056 | testing.expectEqual(linux.io_uring_cqe { |
| 1057 | | .user_data = 456, |
| 1057 | .user_data = 0x22222222, |
| 1058 | 1058 | .res = buffer_read.len, |
| 1059 | 1059 | .flags = 0, |
| 1060 | 1060 | }, cqe_read); |
| ... | ... | @@ -1076,7 +1076,7 @@ test "openat" { |
| 1076 | 1076 | |
| 1077 | 1077 | const flags: u32 = os.O_CLOEXEC | os.O_RDWR | os.O_CREAT; |
| 1078 | 1078 | const mode: os.mode_t = 0o666; |
| 1079 | | const sqe_openat = try ring.openat(789, linux.AT_FDCWD, path, flags, mode); |
| 1079 | const sqe_openat = try ring.openat(0x33333333, linux.AT_FDCWD, path, flags, mode); |
| 1080 | 1080 | testing.expectEqual(io_uring_sqe { |
| 1081 | 1081 | .opcode = .OPENAT, |
| 1082 | 1082 | .flags = 0, |
| ... | ... | @@ -1086,7 +1086,7 @@ test "openat" { |
| 1086 | 1086 | .addr = @ptrToInt(path), |
| 1087 | 1087 | .len = mode, |
| 1088 | 1088 | .rw_flags = flags, |
| 1089 | | .user_data = 789, |
| 1089 | .user_data = 0x33333333, |
| 1090 | 1090 | .buf_index = 0, |
| 1091 | 1091 | .personality = 0, |
| 1092 | 1092 | .splice_fd_in = 0, |
| ... | ... | @@ -1095,7 +1095,7 @@ test "openat" { |
| 1095 | 1095 | testing.expectEqual(@as(u32, 1), try ring.submit()); |
| 1096 | 1096 | |
| 1097 | 1097 | const cqe_openat = try ring.copy_cqe(); |
| 1098 | | testing.expectEqual(@as(u64, 789), cqe_openat.user_data); |
| 1098 | testing.expectEqual(@as(u64, 0x33333333), cqe_openat.user_data); |
| 1099 | 1099 | if (cqe_openat.res == -linux.EINVAL) return error.SkipZigTest; |
| 1100 | 1100 | // AT_FDCWD is not fully supported before kernel 5.6: |
| 1101 | 1101 | // See https://lore.kernel.org/io-uring/20200207155039.12819-1-axboe@kernel.dk/T/ |
| ... | ... | @@ -1125,7 +1125,7 @@ test "close" { |
| 1125 | 1125 | errdefer file.close(); |
| 1126 | 1126 | defer std.fs.cwd().deleteFile(path) catch {}; |
| 1127 | 1127 | |
| 1128 | | const sqe_close = try ring.close(1011, file.handle); |
| 1128 | const sqe_close = try ring.close(0x44444444, file.handle); |
| 1129 | 1129 | testing.expectEqual(linux.IORING_OP.CLOSE, sqe_close.opcode); |
| 1130 | 1130 | testing.expectEqual(file.handle, sqe_close.fd); |
| 1131 | 1131 | testing.expectEqual(@as(u32, 1), try ring.submit()); |
| ... | ... | @@ -1133,7 +1133,7 @@ test "close" { |
| 1133 | 1133 | const cqe_close = try ring.copy_cqe(); |
| 1134 | 1134 | if (cqe_close.res == -linux.EINVAL) return error.SkipZigTest; |
| 1135 | 1135 | testing.expectEqual(linux.io_uring_cqe { |
| 1136 | | .user_data = 1011, |
| 1136 | .user_data = 0x44444444, |
| 1137 | 1137 | .res = 0, |
| 1138 | 1138 | .flags = 0, |
| 1139 | 1139 | }, cqe_close); |