Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AIX] Use sa_sigaction instead the union #4250

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 3 additions & 51 deletions src/unix/aix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<H: hash::Hasher>(&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<H: hash::Hasher>(&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 {
Expand Down