Commit a0205fff98

Alex Rønne Petersen <alex@alexrp.com>
2024-08-31 03:24:19
std.DynLib: Prefer std.fs.File.stat() over posix.fstat().
This is necessary for riscv32-linux.
1 parent 65a6e9e
Changed files (1)
lib/std/dynamic_library.zig
@@ -215,7 +215,8 @@ pub const ElfDynLib = struct {
         const fd = try resolveFromName(path);
         defer posix.close(fd);
 
-        const stat = try posix.fstat(fd);
+        const file: std.fs.File = .{ .handle = fd };
+        const stat = try file.stat();
         const size = std.math.cast(usize, stat.size) orelse return error.FileTooBig;
 
         // This one is to read the ELF info. We do more mmapping later