Skip to content

Bump libc to 0.2.171 to use sigaction for AIX #169

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ members = [
]

[dependencies]
libc = "^0.2"
libc = "^0.2.171"
signal-hook-registry = { version = "^1.4", path = "signal-hook-registry" }

[dev-dependencies]
Expand Down
8 changes: 1 addition & 7 deletions signal-hook-registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,7 @@ impl Slot {
fn new(signal: libc::c_int) -> Result<Self, Error> {
// C data structure, expected to be zeroed out.
let mut new: libc::sigaction = unsafe { mem::zeroed() };
#[cfg(not(target_os = "aix"))]
{ new.sa_sigaction = handler as usize; }
#[cfg(target_os = "aix")]
{ new.sa_union.__su_sigaction = handler; }
new.sa_sigaction = handler as usize;
// Android is broken and uses different int types than the rest (and different depending on
// the pointer width). This converts the flags to the proper type no matter what it is on
// the given platform.
Expand Down Expand Up @@ -239,10 +236,7 @@ impl Prev {

#[cfg(not(windows))]
unsafe fn execute(&self, sig: c_int, info: *mut siginfo_t, data: *mut c_void) {
#[cfg(not(target_os = "aix"))]
let fptr = self.info.sa_sigaction;
#[cfg(target_os = "aix")]
let fptr = self.info.sa_union.__su_sigaction as usize;
if fptr != 0 && fptr != libc::SIG_DFL && fptr != libc::SIG_IGN {
// Android is broken and uses different int types than the rest (and different
// depending on the pointer width). This converts the flags to the proper type no
Expand Down
10 changes: 1 addition & 9 deletions src/low_level/signal_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,7 @@ fn restore_default(signal: c_int) -> Result<(), Error> {
unsafe {
// A C structure, supposed to be memset to 0 before use.
let mut action: libc::sigaction = mem::zeroed();
#[cfg(target_os = "aix")]
{
action.sa_union.__su_sigaction = mem::transmute::<
usize,
extern "C" fn(libc::c_int, *mut libc::siginfo_t, *mut libc::c_void),
>(libc::SIG_DFL);
}
#[cfg(not(target_os = "aix"))]
{ action.sa_sigaction = libc::SIG_DFL as _; }
action.sa_sigaction = libc::SIG_DFL as _;
if libc::sigaction(signal, &action, ptr::null_mut()) == 0 {
Ok(())
} else {
Expand Down