Skip to content

Commit

Permalink
Auto merge of #3185 - valpackett:aix, r=JohnTitor
Browse files Browse the repository at this point in the history
aix: add siginfo_t accessors for symmetry with other platforms

On other platforms it's possible to call e.g. `si_status()`, it was missing on AIX.

btw, the `#[cfg(libc_union)]` usage in the `siginfo_t` itself looks quite wrong…
  • Loading branch information
bors committed Apr 3, 2023
2 parents 2dc31a7 + f932d5c commit 04078d9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/unix/aix/powerpc64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,29 @@ s_no_extra_traits! {
}
}

impl siginfo_t {
pub unsafe fn si_addr(&self) -> *mut ::c_void {
self.si_addr
}

#[cfg(libc_union)]
pub unsafe fn si_value(&self) -> ::sigval {
self.si_value
}

pub unsafe fn si_pid(&self) -> ::pid_t {
self.si_pid
}

pub unsafe fn si_uid(&self) -> ::uid_t {
self.si_uid
}

pub unsafe fn si_status(&self) -> ::c_int {
self.si_status
}
}

cfg_if! {
if #[cfg(feature = "extra_traits")] {
#[cfg(libc_union)]
Expand Down

0 comments on commit 04078d9

Please sign in to comment.