From 89b134856813bf6e302ac98e7eb39f2484858fce Mon Sep 17 00:00:00 2001 From: Qiu Chaofan Date: Tue, 18 Oct 2022 14:11:25 +0800 Subject: [PATCH] Support AIX signal handler type --- src/unix.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/unix.rs b/src/unix.rs index 2474dee..61ba2da 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -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());