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) {...@@ -2528,6 +2528,8 @@ pub const _SC = if (builtin.abi.isAndroid()) enum(c_int) {
2528 .solaris, .illumos => enum(c_int) {2528 .solaris, .illumos => enum(c_int) {
2529 PAGESIZE = 11,2529 PAGESIZE = 11,
2530 NPROCESSORS_ONLN = 15,2530 NPROCESSORS_ONLN = 15,
2531 SIGRT_MIN = 40,
2532 SIGRT_MAX = 41,
2531 },2533 },
2532 // https://github.com/SerenityOS/serenity/blob/1dfc9e2df39dd23f1de92530677c845aae4345f2/Kernel/API/POSIX/unistd.h#L36-L522534 // https://github.com/SerenityOS/serenity/blob/1dfc9e2df39dd23f1de92530677c845aae4345f2/Kernel/API/POSIX/unistd.h#L36-L52
2533 .serenity => enum(c_int) {2535 .serenity => enum(c_int) {
...@@ -10489,6 +10491,7 @@ pub fn sigrtmin() u8 {...@@ -10489,6 +10491,7 @@ pub fn sigrtmin() u8 {
10489 return switch (native_os) {10491 return switch (native_os) {
10490 .freebsd => 65,10492 .freebsd => 65,
10491 .netbsd => 33,10493 .netbsd => 33,
10494 .solaris, .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MIN))),
10492 else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmin()))),10495 else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmin()))),
10493 };10496 };
10494}10497}
...@@ -10498,6 +10501,7 @@ pub fn sigrtmax() u8 {...@@ -10498,6 +10501,7 @@ pub fn sigrtmax() u8 {
10498 return switch (native_os) {10501 return switch (native_os) {
10499 .freebsd => 126,10502 .freebsd => 126,
10500 .netbsd => 63,10503 .netbsd => 63,
10504 .solaris, .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MAX))),
10501 else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmax()))),10505 else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmax()))),
10502 };10506 };
10503}10507}