From fc59f0e7f0681096cf99fbd27330ed7c5ba5ffaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Thu, 15 Jan 2026 08:18:54 +0100 Subject: [PATCH] std.Io.test: skip atime check in `setTimestamps` on NetBSD --- lib/std/Io/test.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/std/Io/test.zig b/lib/std/Io/test.zig index 6d06ebacaaefffcec8d1b4f377b38bb983a42f78..0842f5d092ec2a6d2fb5717f5bfe3515cc82d948 100644 --- a/lib/std/Io/test.zig +++ b/lib/std/Io/test.zig @@ -181,7 +181,10 @@ test "setTimestamps" { .modify_timestamp = .{ .new = stat_old.mtime.subDuration(.fromSeconds(5)) }, }); const stat_new = try file.stat(io); - if (stat_old.atime) |old_atime| try expect(stat_new.atime.?.nanoseconds < old_atime.nanoseconds); + // NetBSD with noatime will just not update the timestamp, and noatime is default in at least NetBSD 11+. + if (builtin.os.tag != .netbsd) { + if (stat_old.atime) |old_atime| try expect(stat_new.atime.?.nanoseconds < old_atime.nanoseconds); + } try expect(stat_new.mtime.nanoseconds < stat_old.mtime.nanoseconds); } -- 2.54.0