commit bbc1c075382b3fa9f275fac097267b7c61b5a899 (tree)
parent 4e95c2eb1b996d7f4dfeaad8112b62733e077273
Author: Andrew Kelley <andrew@ziglang.org>
Date: Mon, 27 Oct 2025 14:54:51 -0700
std.zig.system: fix error set of abiAndDynamicLinkerFromFile
Diffstat:
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig
@@ -543,6 +543,34 @@ fn detectNativeCpuAndFeatures(io: Io, cpu_arch: Target.Cpu.Arch, os: Target.Os,
return null;
}
+pub const AbiAndDynamicLinkerFromFileError = error{
+ Canceled,
+ AccessDenied,
+ Unexpected,
+ Unseekable,
+ ReadFailed,
+ EndOfStream,
+ NameTooLong,
+ StaticElfFile,
+ InvalidElfFile,
+ StreamTooLong,
+ Timeout,
+ SymLinkLoop,
+ SystemResources,
+ ProcessFdQuotaExceeded,
+ SystemFdQuotaExceeded,
+ ProcessNotFound,
+ IsDir,
+ WouldBlock,
+ InputOutput,
+ BrokenPipe,
+ ConnectionResetByPeer,
+ NotOpenForReading,
+ SocketUnconnected,
+ LockViolation,
+ FileSystem,
+};
+
fn abiAndDynamicLinkerFromFile(
file_reader: *Io.File.Reader,
header: *const elf.Header,
@@ -550,7 +578,7 @@ fn abiAndDynamicLinkerFromFile(
os: Target.Os,
ld_info_list: []const LdInfo,
query: Target.Query,
-) !Target {
+) AbiAndDynamicLinkerFromFileError!Target {
const io = file_reader.io;
var result: Target = .{
.cpu = cpu,