summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-10 16:32:05 +0000
committerbors <bors@rust-lang.org>2023-04-10 16:32:05 +0000
commitc1a63d502f166e44cdd30ab95f9ac86954bf8bea (patch)
treee69af57779699b42c71488aaf8a635c607c2ce70
parent7eb82d35a929b581794a4c0aed8d8f4295276a8e (diff)
parent7a1d2c6f9daa45f88810b93d6e28ed612a001397 (diff)
downloadrust-libc-c1a63d502f166e44cdd30ab95f9ac86954bf8bea.tar.gz
Auto merge of #3189 - ecnelises:aix_sigval_fix, r=JohnTitor
Remove AIX specific definition of sigval AIX definition of sigval is actually the same as other unix. Remove the union definition as other platforms treat it like a pointer after #3185.
-rw-r--r--src/unix/aix/mod.rs2
-rw-r--r--src/unix/aix/powerpc64.rs42
2 files changed, 3 insertions, 41 deletions
diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs
index bbc3b0a717..ffe3f18284 100644
--- a/src/unix/aix/mod.rs
+++ b/src/unix/aix/mod.rs
@@ -313,7 +313,7 @@ s! {
pub sigev_value: ::sigval,
pub sigev_signo: ::c_int,
pub sigev_notify: ::c_int,
- pub sigev_notify_function: extern fn(val: sigval),
+ pub sigev_notify_function: extern fn(val: ::sigval),
pub sigev_notify_attributes: *mut pthread_attr_t,
}
diff --git a/src/unix/aix/powerpc64.rs b/src/unix/aix/powerpc64.rs
index 30cc8d18ac..2cacf29f6b 100644
--- a/src/unix/aix/powerpc64.rs
+++ b/src/unix/aix/powerpc64.rs
@@ -185,12 +185,6 @@ s! {
}
s_no_extra_traits! {
- #[cfg(libc_union)]
- pub union sigval {
- pub sival_ptr: *mut ::c_void,
- pub sival_int: ::c_int,
- }
-
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_errno: ::c_int,
@@ -200,8 +194,7 @@ s_no_extra_traits! {
pub si_status: ::c_int,
pub si_addr: *mut ::c_void,
pub si_band: ::c_long,
- #[cfg(libc_union)]
- pub si_value: sigval,
+ pub si_value: ::sigval,
pub __si_flags: ::c_int,
pub __pad: [::c_int; 3],
}
@@ -286,7 +279,6 @@ impl siginfo_t {
self.si_addr
}
- #[cfg(libc_union)]
pub unsafe fn si_value(&self) -> ::sigval {
self.si_value
}
@@ -306,36 +298,6 @@ impl siginfo_t {
cfg_if! {
if #[cfg(feature = "extra_traits")] {
- #[cfg(libc_union)]
- impl PartialEq for sigval {
- fn eq(&self, other: &sigval) -> bool {
- unsafe {
- self.sival_ptr == other.sival_ptr
- && self.sival_int == other.sival_int
- }
- }
- }
- #[cfg(libc_union)]
- impl Eq for sigval {}
- #[cfg(libc_union)]
- impl ::fmt::Debug for sigval {
- fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
- f.debug_struct("sigval")
- .field("sival_ptr", unsafe { &self.sival_ptr })
- .field("sival_int", unsafe { &self.sival_int })
- .finish()
- }
- }
- #[cfg(libc_union)]
- impl ::hash::Hash for sigval {
- fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
- unsafe {
- self.sival_ptr.hash(state);
- self.sival_int.hash(state);
- }
- }
- }
-
impl PartialEq for siginfo_t {
fn eq(&self, other: &siginfo_t) -> bool {
#[cfg(libc_union)]
@@ -402,7 +364,7 @@ cfg_if! {
#[cfg(libc_union)]
impl ::fmt::Debug for _kernel_simple_lock {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
- f.debug_struct("sigval")
+ f.debug_struct("_kernel_simple_lock")
.field("_slock", unsafe { &self._slock })
.field("_slockp", unsafe { &self._slockp })
.finish()