authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-12-18 00:54:04 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-12-18 00:54:04 -08:00
log343b29cf587842ffa5874abd405bdb97b6c8649d
treec2f5218ab473446c151507341017e3f00524b705
parent9a4f8159be199f9a94d96a9cb41f4a88c592b46f

fix File.stat() on mips64


1 files changed, 11 insertions(+), 0 deletions(-)

File.zig+11
......@@ -47,6 +47,17 @@ pub fn anyReadable(self: File) nio.AnyReadable {
4747pub fn stat(self: File) !Stat {
4848 if (os != .linux) @compileError("TODO: File.stat");
4949 const st = try sys_linux.fstat(@intFromEnum(self.fd));
50 if (builtin.target.cpu.arch.isMIPS64()) {
51 return .{
52 .inode = st.ino,
53 .size = @bitCast(st.size),
54 .mode = st.mode,
55 .kind = {},
56 .atime = @as(i128, st.atim) * time.ns_per_s + st.atim_nsec,
57 .mtime = @as(i128, st.mtim) * time.ns_per_s + st.mtim_nsec,
58 .ctime = @as(i128, st.ctim) * time.ns_per_s + st.ctim_nsec,
59 };
60 }
5061 return .{
5162 .inode = st.ino,
5263 .size = @bitCast(st.size),