Skip to content

Commit

Permalink
Merge pull request #46 from ecnelises/aix
Browse files Browse the repository at this point in the history
Support AIX signal handler type
  • Loading branch information
alexcrichton authored Oct 26, 2022
2 parents c9b5c79 + 89b1348 commit 23c7fa6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,14 @@ pub(crate) fn spawn_helper(
let mut err = None;
USR1_INIT.call_once(|| unsafe {
let mut new: libc::sigaction = mem::zeroed();
new.sa_sigaction = sigusr1_handler as usize;
#[cfg(target_os = "aix")]
{
new.sa_union.__su_sigaction = sigusr1_handler;
}
#[cfg(not(target_os = "aix"))]
{
new.sa_sigaction = sigusr1_handler as usize;
}
new.sa_flags = libc::SA_SIGINFO as _;
if libc::sigaction(libc::SIGUSR1, &new, ptr::null_mut()) != 0 {
err = Some(io::Error::last_os_error());
Expand Down

0 comments on commit 23c7fa6

Please sign in to comment.