authorgravatar for ryan@zinascii.comRyan Zezeski <ryan@zinascii.com> 2025-10-25 10:41:04+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-25 12:44:17+02:00
logece9640a3ed44b0e174f3620fc40511ef86e1903
treeb2df95d82c1067602fa9bf4f5ebdd3593ef3d7ed
parentbd1332acaeabd7b846b4df7c63b1221858c80bf1
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.c: implement sigrtmin()/sigrtmax() for solaris/illumos


1 files changed, 4 insertions(+), 0 deletions(-)

lib/std/c.zig+4
......@@ -2528,6 +2528,8 @@ pub const _SC = if (builtin.abi.isAndroid()) enum(c_int) {
25282528 .solaris, .illumos => enum(c_int) {
25292529 PAGESIZE = 11,
25302530 NPROCESSORS_ONLN = 15,
2531 SIGRT_MIN = 40,
2532 SIGRT_MAX = 41,
25312533 },
25322534 // https://github.com/SerenityOS/serenity/blob/1dfc9e2df39dd23f1de92530677c845aae4345f2/Kernel/API/POSIX/unistd.h#L36-L52
25332535 .serenity => enum(c_int) {
......@@ -10489,6 +10491,7 @@ pub fn sigrtmin() u8 {
1048910491 return switch (native_os) {
1049010492 .freebsd => 65,
1049110493 .netbsd => 33,
10494 .solaris, .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MIN))),
1049210495 else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmin()))),
1049310496 };
1049410497}
......@@ -10498,6 +10501,7 @@ pub fn sigrtmax() u8 {
1049810501 return switch (native_os) {
1049910502 .freebsd => 126,
1050010503 .netbsd => 63,
10504 .solaris, .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MAX))),
1050110505 else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmax()))),
1050210506 };
1050310507}