diff --git a/lib/std/Io/Uring.zig b/lib/std/Io/Uring.zig index 58d97dc0e8e090c84bec204f74be93a8bd5e5c37..6edf381378148e64941e64559150f77ad94a0650 100644 --- a/lib/std/Io/Uring.zig +++ b/lib/std/Io/Uring.zig @@ -3561,7 +3561,7 @@ fn dirHardLink( old_sub_path_posix, new_dir.handle, new_sub_path_posix, - if (options.follow_symlinks) 0 else linux.AT.SYMLINK_NOFOLLOW, + if (options.follow_symlinks) linux.AT.SYMLINK_FOLLOW else 0, ); } @@ -3993,7 +3993,7 @@ fn fileHardLink( "", new_dir.handle, new_sub_path_posix, - linux.AT.EMPTY_PATH | @as(u32, if (options.follow_symlinks) 0 else linux.AT.SYMLINK_NOFOLLOW), + linux.AT.EMPTY_PATH | @as(u32, if (options.follow_symlinks) linux.AT.SYMLINK_FOLLOW else 0), ); } @@ -5545,6 +5545,8 @@ fn linkat( new_path: [*:0]const u8, flags: u32, ) File.HardLinkError!void { + // allowed flags: https://man7.org/linux/man-pages/man2/linkat.2.html + assert(flags & ~(@as(u32, linux.AT.SYMLINK_FOLLOW | linux.AT.EMPTY_PATH)) == 0); while (true) { const thread = try cancel_region.awaitIoUring(); thread.enqueue().* = .{