commit 1553c8eae7d830cb793e78c3e52ad816fa8efd23 (tree)
parent 030b630829d3fe9c6c387a9bf68ae65ddb3b053c
Author: Andrew Kelley <andrew@ziglang.org>
Date: Tue, 28 Oct 2025 08:27:07 -0700
std.os.linux.x86: fix signal restore function
After handling any signal on x86, it would previously segfault.
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/lib/std/os/linux/x86.zig b/lib/std/os/linux/x86.zig
@@ -159,12 +159,14 @@ pub fn clone() callconv(.naked) u32 {
pub fn restore() callconv(.naked) noreturn {
switch (builtin.zig_backend) {
.stage2_c => asm volatile (
+ \\ addl $4, %%esp
\\ movl %[number], %%eax
\\ int $0x80
:
: [number] "i" (@intFromEnum(SYS.sigreturn)),
),
else => asm volatile (
+ \\ addl $4, %%esp
\\ int $0x80
:
: [number] "{eax}" (@intFromEnum(SYS.sigreturn)),