authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-05 20:39:24-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-05 21:54:05-07:00
logc34392b24e5ef69f34dd73f08d9e1e9add1385cd
treedf9d8911dabe5dc8d4111c5f8d1267c33019c989
parentf639cb33a9acf71e32fb69882cf59250148cfaff

std.os.linux.io_uring: work around LLVM bug

See #12014

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

lib/std/os/linux/io_uring.zig+7-1
......@@ -1902,6 +1902,12 @@ test "openat" {
19021902 const path = "test_io_uring_openat";
19031903 defer std.fs.cwd().deleteFile(path) catch {};
19041904
1905 // Workaround for LLVM bug: https://github.com/ziglang/zig/issues/12014
1906 const path_addr = if (builtin.zig_backend == .stage2_llvm) p: {
1907 var workaround = path;
1908 break :p @ptrToInt(workaround);
1909 } else @ptrToInt(path);
1910
19051911 const flags: u32 = os.O.CLOEXEC | os.O.RDWR | os.O.CREAT;
19061912 const mode: os.mode_t = 0o666;
19071913 const sqe_openat = try ring.openat(0x33333333, linux.AT.FDCWD, path, flags, mode);
......@@ -1911,7 +1917,7 @@ test "openat" {
19111917 .ioprio = 0,
19121918 .fd = linux.AT.FDCWD,
19131919 .off = 0,
1914 .addr = @ptrToInt(path),
1920 .addr = path_addr,
19151921 .len = mode,
19161922 .rw_flags = flags,
19171923 .user_data = 0x33333333,