mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-07 14:24:43 +00:00
std.DynLib: Prefer std.fs.File.stat() over posix.fstat().
This is necessary for riscv32-linux.
This commit is contained in:
parent
65a6e9eee5
commit
a0205fff98
1 changed files with 2 additions and 1 deletions
|
|
@ -215,7 +215,8 @@ pub const ElfDynLib = struct {
|
||||||
const fd = try resolveFromName(path);
|
const fd = try resolveFromName(path);
|
||||||
defer posix.close(fd);
|
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;
|
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
|
// This one is to read the ELF info. We do more mmapping later
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue