From 18db762bb8385bb468a3d479c715f6ec906f7d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Mon, 1 Dec 2025 07:37:34 +0100 Subject: [PATCH] std.c: openbsd does not have SIGRTMIN/SIGRTMAX --- lib/std/c.zig | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/lib/std/c.zig b/lib/std/c.zig index c39c8721ed48bfbe8beac399389dd9f5258745cb..656bdc35bbf02199c6a71ed2cab60f025b7cb0c4 100644 --- a/lib/std/c.zig +++ b/lib/std/c.zig @@ -10468,24 +10468,36 @@ pub const sigaction = switch (native_os) { }; /// Zig's version of SIGRTMIN. Actually a function. -pub fn sigrtmin() u8 { - return switch (native_os) { - .freebsd => 65, - .netbsd => 33, - .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MIN))), - else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmin()))), - }; -} +pub const sigrtmin = switch (native_os) { + .openbsd => {}, + else => sigrt_private.sigrtmin, +}; /// Zig's version of SIGRTMAX. Actually a function. -pub fn sigrtmax() u8 { - return switch (native_os) { - .freebsd => 126, - .netbsd => 63, - .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MAX))), - else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmax()))), - }; -} +pub const sigrtmax = switch (native_os) { + .openbsd => {}, + else => sigrt_private.sigrtmax, +}; + +const sigrt_private = struct { + pub fn sigrtmin() u8 { + return switch (native_os) { + .freebsd => 65, + .netbsd => 33, + .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MIN))), + else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmin()))), + }; + } + + pub fn sigrtmax() u8 { + return switch (native_os) { + .freebsd => 126, + .netbsd => 63, + .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MAX))), + else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmax()))), + }; + } +}; pub const sigfillset = switch (native_os) { .netbsd => private.__sigfillset14, -- 2.54.0