commit ece9640a3ed44b0e174f3620fc40511ef86e1903 (tree)
parent bd1332acaeabd7b846b4df7c63b1221858c80bf1
Author: Ryan Zezeski <ryan@zinascii.com>
Date: Sat, 25 Oct 2025 10:41:04 +0200
std.c: implement sigrtmin()/sigrtmax() for solaris/illumos
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/lib/std/c.zig b/lib/std/c.zig
@@ -2528,6 +2528,8 @@ pub const _SC = if (builtin.abi.isAndroid()) enum(c_int) {
.solaris, .illumos => enum(c_int) {
PAGESIZE = 11,
NPROCESSORS_ONLN = 15,
+ SIGRT_MIN = 40,
+ SIGRT_MAX = 41,
},
// https://github.com/SerenityOS/serenity/blob/1dfc9e2df39dd23f1de92530677c845aae4345f2/Kernel/API/POSIX/unistd.h#L36-L52
.serenity => enum(c_int) {
@@ -10489,6 +10491,7 @@ pub fn sigrtmin() u8 {
return switch (native_os) {
.freebsd => 65,
.netbsd => 33,
+ .solaris, .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MIN))),
else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmin()))),
};
}
@@ -10498,6 +10501,7 @@ pub fn sigrtmax() u8 {
return switch (native_os) {
.freebsd => 126,
.netbsd => 63,
+ .solaris, .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MAX))),
else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmax()))),
};
}