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
This commit is contained in:
Alex Rønne Petersen 2026-01-19 18:46:00 +01:00
parent 32f977a4b7
commit a3ea3bd31d
No known key found for this signature in database
2 changed files with 1 additions and 2 deletions

View file

@ -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();

View file

@ -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,
};
}