| ... | @@ -2674,6 +2674,7 @@ pub const ReadLinkError = error{ | ... | @@ -2674,6 +2674,7 @@ pub const ReadLinkError = error{ |
| 2674 | NameTooLong, | 2674 | NameTooLong, |
| 2675 | FileNotFound, | 2675 | FileNotFound, |
| 2676 | SystemResources, | 2676 | SystemResources, |
| | 2677 | NotLink, |
| 2677 | NotDir, | 2678 | NotDir, |
| 2678 | InvalidUtf8, | 2679 | InvalidUtf8, |
| 2679 | BadPathName, | 2680 | BadPathName, |
| ... | @@ -2715,7 +2716,7 @@ pub fn readlinkZ(file_path: [*:0]const u8, out_buffer: []u8) ReadLinkError![]u8 | ... | @@ -2715,7 +2716,7 @@ pub fn readlinkZ(file_path: [*:0]const u8, out_buffer: []u8) ReadLinkError![]u8 |
| 2715 | .SUCCESS => return out_buffer[0..@bitCast(usize, rc)], | 2716 | .SUCCESS => return out_buffer[0..@bitCast(usize, rc)], |
| 2716 | .ACCES => return error.AccessDenied, | 2717 | .ACCES => return error.AccessDenied, |
| 2717 | .FAULT => unreachable, | 2718 | .FAULT => unreachable, |
| 2718 | .INVAL => unreachable, | 2719 | .INVAL => return error.NotLink, |
| 2719 | .IO => return error.FileSystem, | 2720 | .IO => return error.FileSystem, |
| 2720 | .LOOP => return error.SymLinkLoop, | 2721 | .LOOP => return error.SymLinkLoop, |
| 2721 | .NAMETOOLONG => return error.NameTooLong, | 2722 | .NAMETOOLONG => return error.NameTooLong, |
| ... | @@ -2751,7 +2752,7 @@ pub fn readlinkatWasi(dirfd: fd_t, file_path: []const u8, out_buffer: []u8) Read | ... | @@ -2751,7 +2752,7 @@ pub fn readlinkatWasi(dirfd: fd_t, file_path: []const u8, out_buffer: []u8) Read |
| 2751 | .SUCCESS => return out_buffer[0..bufused], | 2752 | .SUCCESS => return out_buffer[0..bufused], |
| 2752 | .ACCES => return error.AccessDenied, | 2753 | .ACCES => return error.AccessDenied, |
| 2753 | .FAULT => unreachable, | 2754 | .FAULT => unreachable, |
| 2754 | .INVAL => unreachable, | 2755 | .INVAL => return error.NotLink, |
| 2755 | .IO => return error.FileSystem, | 2756 | .IO => return error.FileSystem, |
| 2756 | .LOOP => return error.SymLinkLoop, | 2757 | .LOOP => return error.SymLinkLoop, |
| 2757 | .NAMETOOLONG => return error.NameTooLong, | 2758 | .NAMETOOLONG => return error.NameTooLong, |
| ... | @@ -2781,7 +2782,7 @@ pub fn readlinkatZ(dirfd: fd_t, file_path: [*:0]const u8, out_buffer: []u8) Read | ... | @@ -2781,7 +2782,7 @@ pub fn readlinkatZ(dirfd: fd_t, file_path: [*:0]const u8, out_buffer: []u8) Read |
| 2781 | .SUCCESS => return out_buffer[0..@bitCast(usize, rc)], | 2782 | .SUCCESS => return out_buffer[0..@bitCast(usize, rc)], |
| 2782 | .ACCES => return error.AccessDenied, | 2783 | .ACCES => return error.AccessDenied, |
| 2783 | .FAULT => unreachable, | 2784 | .FAULT => unreachable, |
| 2784 | .INVAL => unreachable, | 2785 | .INVAL => return error.NotLink, |
| 2785 | .IO => return error.FileSystem, | 2786 | .IO => return error.FileSystem, |
| 2786 | .LOOP => return error.SymLinkLoop, | 2787 | .LOOP => return error.SymLinkLoop, |
| 2787 | .NAMETOOLONG => return error.NameTooLong, | 2788 | .NAMETOOLONG => return error.NameTooLong, |
| ... | @@ -4758,6 +4759,7 @@ pub fn getFdPath(fd: fd_t, out_buffer: *[MAX_PATH_BYTES]u8) RealPathError![]u8 { | ... | @@ -4758,6 +4759,7 @@ pub fn getFdPath(fd: fd_t, out_buffer: *[MAX_PATH_BYTES]u8) RealPathError![]u8 { |
| 4758 | const target = readlinkZ(std.meta.assumeSentinel(proc_path.ptr, 0), out_buffer) catch |err| { | 4759 | const target = readlinkZ(std.meta.assumeSentinel(proc_path.ptr, 0), out_buffer) catch |err| { |
| 4759 | switch (err) { | 4760 | switch (err) { |
| 4760 | error.UnsupportedReparsePointType => unreachable, // Windows only, | 4761 | error.UnsupportedReparsePointType => unreachable, // Windows only, |
| | 4762 | error.NotLink => unreachable, |
| 4761 | else => |e| return e, | 4763 | else => |e| return e, |
| 4762 | } | 4764 | } |
| 4763 | }; | 4765 | }; |
| ... | @@ -4769,6 +4771,7 @@ pub fn getFdPath(fd: fd_t, out_buffer: *[MAX_PATH_BYTES]u8) RealPathError![]u8 { | ... | @@ -4769,6 +4771,7 @@ pub fn getFdPath(fd: fd_t, out_buffer: *[MAX_PATH_BYTES]u8) RealPathError![]u8 { |
| 4769 | | 4771 | |
| 4770 | const target = readlinkZ(proc_path, out_buffer) catch |err| switch (err) { | 4772 | const target = readlinkZ(proc_path, out_buffer) catch |err| switch (err) { |
| 4771 | error.UnsupportedReparsePointType => unreachable, | 4773 | error.UnsupportedReparsePointType => unreachable, |
| | 4774 | error.NotLink => unreachable, |
| 4772 | else => |e| return e, | 4775 | else => |e| return e, |
| 4773 | }; | 4776 | }; |
| 4774 | return target; | 4777 | return target; |