Skip to content

Commit 23c7fa6

Browse files
authored
Merge pull request #46 from ecnelises/aix
Support AIX signal handler type
2 parents c9b5c79 + 89b1348 commit 23c7fa6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/unix.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,14 @@ pub(crate) fn spawn_helper(
243243
let mut err = None;
244244
USR1_INIT.call_once(|| unsafe {
245245
let mut new: libc::sigaction = mem::zeroed();
246-
new.sa_sigaction = sigusr1_handler as usize;
246+
#[cfg(target_os = "aix")]
247+
{
248+
new.sa_union.__su_sigaction = sigusr1_handler;
249+
}
250+
#[cfg(not(target_os = "aix"))]
251+
{
252+
new.sa_sigaction = sigusr1_handler as usize;
253+
}
247254
new.sa_flags = libc::SA_SIGINFO as _;
248255
if libc::sigaction(libc::SIGUSR1, &new, ptr::null_mut()) != 0 {
249256
err = Some(io::Error::last_os_error());

0 commit comments

Comments
 (0)