commit a3ea3bd31dc0b8c6ff98c9bc95ffcd36bd8aba82 (tree)
parent 32f977a4b7b17b774ff09157a902d4e22adf7384
Author: Alex Rønne Petersen <alex@alexrp.com>
Date: Mon, 19 Jan 2026 18:46:00 +0100
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
Diffstat:
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig
@@ -5209,7 +5209,7 @@ fn fileRealPathPosix(userdata: ?*anyopaque, file: File, out_buffer: []u8) File.R
fn realPathPosix(fd: posix.fd_t, out_buffer: []u8) File.RealPathError!usize {
switch (native_os) {
- .netbsd, .dragonfly, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => {
+ .dragonfly, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => {
var sufficient_buffer: [posix.PATH_MAX]u8 = undefined;
@memset(&sufficient_buffer, 0);
const syscall: Syscall = try .start();
diff --git a/lib/std/fs/test.zig b/lib/std/fs/test.zig
@@ -37,7 +37,6 @@ pub inline fn isRealPathSupported() bool {
.freebsd,
=> true,
.dragonfly => builtin.os.version_range.semver.min.order(.{ .major = 6, .minor = 0, .patch = 0 }) != .lt,
- .netbsd => builtin.os.version_range.semver.min.order(.{ .major = 10, .minor = 0, .patch = 0 }) != .lt,
else => false,
};
}