From 343b29cf587842ffa5874abd405bdb97b6c8649d Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Thu, 18 Dec 2025 00:54:04 -0800 Subject: [PATCH] fix File.stat() on mips64 --- File.zig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/File.zig b/File.zig index 2bc0a0dca7ec041e6207016e2738e861c934c87c..8e905df91378b8bc7d017ef2091f4c5f5c49d4be 100644 --- a/File.zig +++ b/File.zig @@ -47,6 +47,17 @@ pub fn anyReadable(self: File) nio.AnyReadable { pub fn stat(self: File) !Stat { if (os != .linux) @compileError("TODO: File.stat"); const st = try sys_linux.fstat(@intFromEnum(self.fd)); + if (builtin.target.cpu.arch.isMIPS64()) { + return .{ + .inode = st.ino, + .size = @bitCast(st.size), + .mode = st.mode, + .kind = {}, + .atime = @as(i128, st.atim) * time.ns_per_s + st.atim_nsec, + .mtime = @as(i128, st.mtim) * time.ns_per_s + st.mtim_nsec, + .ctime = @as(i128, st.ctim) * time.ns_per_s + st.ctim_nsec, + }; + } return .{ .inode = st.ino, .size = @bitCast(st.size), -- 2.54.0