Skip to content

Commit

Permalink
Auto merge of #1329 - alex:patch-1, r=gnzlbg
Browse files Browse the repository at this point in the history
Deprecate _pad field on siginfo_t

As discussed in #1316
  • Loading branch information
bors committed May 2, 2019
2 parents e2bf06c + 9b43ade commit 11f30a8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/unix/notbsd/linux/other/mod.rs
Expand Up @@ -48,6 +48,12 @@ s! {
pub si_signo: ::c_int,
pub si_errno: ::c_int,
pub si_code: ::c_int,
#[deprecated(
since="0.2.54",
note="Please leave a comment on \
https://github.com/rust-lang/libc/pull/1316 if you're using \
this field"
)]
pub _pad: [::c_int; 29],
#[cfg(target_arch = "x86_64")]
_align: [u64; 0],
Expand Down Expand Up @@ -194,6 +200,19 @@ s! {
}
}

impl siginfo_t {
pub unsafe fn si_addr(&self) -> *mut ::c_void {
#[repr(C)]
struct siginfo_sigfault {
_si_signo: ::c_int,
_si_errno: ::c_int,
_si_code: ::c_int,
si_addr: *mut ::c_void
}
(*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr
}
}

s_no_extra_traits! {
pub struct utmpx {
pub ut_type: ::c_short,
Expand Down

0 comments on commit 11f30a8

Please sign in to comment.