Commit 11f30a88 authored by bors's avatar bors

Auto merge of #1329 - alex:patch-1, r=gnzlbg

Deprecate _pad field on siginfo_t

As discussed in https://github.com/rust-lang/libc/pull/1316
parents e2bf06c1 9b43adea
...@@ -48,6 +48,12 @@ s! { ...@@ -48,6 +48,12 @@ s! {
pub si_signo: ::c_int, pub si_signo: ::c_int,
pub si_errno: ::c_int, pub si_errno: ::c_int,
pub si_code: ::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], pub _pad: [::c_int; 29],
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]
_align: [u64; 0], _align: [u64; 0],
...@@ -194,6 +200,19 @@ s! { ...@@ -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! { s_no_extra_traits! {
pub struct utmpx { pub struct utmpx {
pub ut_type: ::c_short, pub ut_type: ::c_short,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment