From 597c610b64132f91311434993851c7d9a0d8ca6c Mon Sep 17 00:00:00 2001 From: Xing Xue Date: Thu, 23 Jan 2025 14:55:21 -0500 Subject: [PATCH] Use sa_sigaction instead the union for AIX. --- src/unix/aix/mod.rs | 54 +++------------------------------------------ 1 file changed, 3 insertions(+), 51 deletions(-) diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs index ec3ae37b1a95..4fe58f0336c2 100644 --- a/src/unix/aix/mod.rs +++ b/src/unix/aix/mod.rs @@ -533,20 +533,15 @@ s! { pub it_interval: crate::timespec, pub it_value: crate::timespec, } -} - -s_no_extra_traits! { - pub union __sigaction_sa_union { - pub __su_handler: extern "C" fn(c: c_int), - pub __su_sigaction: extern "C" fn(c: c_int, info: *mut siginfo_t, ptr: *mut c_void), - } pub struct sigaction { - pub sa_union: __sigaction_sa_union, + pub sa_sigaction: crate::sighandler_t, //actually a union with sa_handle pub sa_mask: sigset_t, pub sa_flags: c_int, } +} +s_no_extra_traits! { pub union __poll_ctl_ext_u { pub addr: *mut c_void, pub data32: u32, @@ -565,49 +560,6 @@ s_no_extra_traits! { cfg_if! { if #[cfg(feature = "extra_traits")] { - impl PartialEq for __sigaction_sa_union { - fn eq(&self, other: &__sigaction_sa_union) -> bool { - unsafe { - self.__su_handler == other.__su_handler - && self.__su_sigaction == other.__su_sigaction - } - } - } - impl Eq for __sigaction_sa_union {} - impl hash::Hash for __sigaction_sa_union { - fn hash(&self, state: &mut H) { - unsafe { - self.__su_handler.hash(state); - self.__su_sigaction.hash(state); - } - } - } - - impl PartialEq for sigaction { - fn eq(&self, other: &sigaction) -> bool { - self.sa_mask == other.sa_mask - && self.sa_flags == other.sa_flags - && self.sa_union == other.sa_union - } - } - impl Eq for sigaction {} - impl fmt::Debug for sigaction { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("sigaction") - .field("sa_union", &self.sa_union) - .field("sa_mask", &self.sa_mask) - .field("sa_flags", &self.sa_flags) - .finish() - } - } - impl hash::Hash for sigaction { - fn hash(&self, state: &mut H) { - self.sa_union.hash(state); - self.sa_mask.hash(state); - self.sa_flags.hash(state); - } - } - impl PartialEq for __poll_ctl_ext_u { fn eq(&self, other: &__poll_ctl_ext_u) -> bool { unsafe {