authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-31 03:24:19+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-09-06 20:03:15+02:00
loga0205fff98f1e3df24d28b78b86d6e8f385d350f
tree1ffbf7b72d0eb904798391a648d729cdc02de550
parent65a6e9eee5f0c59622e97c6fd0f283bf2594d6c5
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.DynLib: Prefer std.fs.File.stat() over posix.fstat().

This is necessary for riscv32-linux.

1 files changed, 2 insertions(+), 1 deletions(-)

lib/std/dynamic_library.zig+2-1
...@@ -215,7 +215,8 @@ pub const ElfDynLib = struct {...@@ -215,7 +215,8 @@ pub const ElfDynLib = struct {
215 const fd = try resolveFromName(path);215 const fd = try resolveFromName(path);
216 defer posix.close(fd);216 defer posix.close(fd);
217217
218 const stat = try posix.fstat(fd);218 const file: std.fs.File = .{ .handle = fd };
219 const stat = try file.stat();
219 const size = std.math.cast(usize, stat.size) orelse return error.FileTooBig;220 const size = std.math.cast(usize, stat.size) orelse return error.FileTooBig;
220221
221 // This one is to read the ELF info. We do more mmapping later222 // This one is to read the ELF info. We do more mmapping later