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 {...@@ -47,6 +47,17 @@ pub fn anyReadable(self: File) nio.AnyReadable {
47pub fn stat(self: File) !Stat {47pub fn stat(self: File) !Stat {
48 if (os != .linux) @compileError("TODO: File.stat");48 if (os != .linux) @compileError("TODO: File.stat");
49 const st = try sys_linux.fstat(@intFromEnum(self.fd));49 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 }
50 return .{61 return .{
51 .inode = st.ino,62 .inode = st.ino,
52 .size = @bitCast(st.size),63 .size = @bitCast(st.size),