Skip to content

Commit

Permalink
[solaris/illumos] add SIGRTMIN and SIGRTMAX
Browse files Browse the repository at this point in the history
Add these functions, similar to the Linux ones. Also add tests.

For illumos, the source code is at [1] and documentation is at [2]. Blame
suggests that Solaris also supports the same calls.

[1]: https://github.com/illumos/illumos-gate/blame/27ecbff00d8c86a2647d6fe325cacb220d712115/usr/src/uts/common/sys/iso/signal_iso.h#L100-L101
[2]: https://illumos.org/man/3HEAD/signal.h

(backport <rust-lang#4171>)
(cherry picked from commit a8aaadf)
  • Loading branch information
sunshowers authored and tgross35 committed Dec 9, 2024
1 parent d673baa commit 76b35d3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ fn do_cc() {
|| target.contains("l4re")
|| target.contains("android")
|| target.contains("emscripten")
|| target.contains("solaris")
|| target.contains("illumos")
{
cc::Build::new().file("src/sigrt.c").compile("sigrt");
}
Expand Down
2 changes: 2 additions & 0 deletions libc-test/semver/solarish.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ LIO_WAIT
LIO_WRITE
PIPE_BUF
SIGEV_PORT
SIGRTMAX
SIGRTMIN
_POSIX_VDISABLE
_ST_FSTYPSZ
aio_cancel
Expand Down
4 changes: 3 additions & 1 deletion libc-test/test/sigrt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
target_os = "linux",
target_os = "l4re",
target_os = "android",
target_os = "emscripten"
target_os = "emscripten",
target_os = "solaris",
target_os = "illumos",
))]
mod t {
use libc;
Expand Down
8 changes: 8 additions & 0 deletions src/unix/solarish/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2542,6 +2542,14 @@ f! {
}

safe_f! {
pub fn SIGRTMAX() -> c_int {
unsafe { crate::sysconf(_SC_SIGRT_MAX) as c_int }
}

pub fn SIGRTMIN() -> c_int {
unsafe { crate::sysconf(_SC_SIGRT_MIN) as c_int }
}

pub {const} fn WIFEXITED(status: c_int) -> bool {
(status & 0xFF) == 0
}
Expand Down

0 comments on commit 76b35d3

Please sign in to comment.