authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-01-19 18:46:00+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-01-21 16:41:51+01:00
loga3ea3bd31dc0b8c6ff98c9bc95ffcd36bd8aba82
tree37efe2aca691541db996a25eaaee8a8a6e3565d7
parent32f977a4b7b17b774ff09157a902d4e22adf7384
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std: NetBSD doesn't have a reliable F_GETPATH

It can fail arbitrarily with ENOENT if the kernel happens to not have the FD in its name cache. That makes it useless for our purposes. closes https://codeberg.org/ziglang/zig/issues/30843

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

lib/std/Io/Threaded.zig+1-1
......@@ -5209,7 +5209,7 @@ fn fileRealPathPosix(userdata: ?*anyopaque, file: File, out_buffer: []u8) File.R
52095209
52105210fn realPathPosix(fd: posix.fd_t, out_buffer: []u8) File.RealPathError!usize {
52115211 switch (native_os) {
5212 .netbsd, .dragonfly, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => {
5212 .dragonfly, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => {
52135213 var sufficient_buffer: [posix.PATH_MAX]u8 = undefined;
52145214 @memset(&sufficient_buffer, 0);
52155215 const syscall: Syscall = try .start();
lib/std/fs/test.zig-1
......@@ -37,7 +37,6 @@ pub inline fn isRealPathSupported() bool {
3737 .freebsd,
3838 => true,
3939 .dragonfly => builtin.os.version_range.semver.min.order(.{ .major = 6, .minor = 0, .patch = 0 }) != .lt,
40 .netbsd => builtin.os.version_range.semver.min.order(.{ .major = 10, .minor = 0, .patch = 0 }) != .lt,
4140 else => false,
4241 };
4342}