From 2a7683933a0304d3cfc051f7299d7d7cbf7c0042 Mon Sep 17 00:00:00 2001 From: Pat Tullmann Date: Tue, 8 Apr 2025 14:03:31 -0700 Subject: [PATCH] linux.zig: epoll_wait: pass kernel sigset size Linux kernel syscalls expect to be given the number of bits of sigset that they're built for, not the full 1024-bit sigsets that glibc supports. I audited the other syscalls in here that use `sigset_t` and they're all using `NSIG / 8`. Fixes #12715 --- lib/std/os/linux.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index a99cabfeab1cacefd6cc6f74d88b2df84c4a8e2f..74b0dae90e2397d6d1e3cc7cb1c42e60288d7b4c 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -2221,7 +2221,7 @@ pub fn epoll_pwait(epoll_fd: i32, events: [*]epoll_event, maxevents: u32, timeou @as(usize, @intCast(maxevents)), @as(usize, @bitCast(@as(isize, timeout))), @intFromPtr(sigmask), - @sizeOf(sigset_t), + NSIG / 8, ); } -- 2.54.0