|
1 | 1 | pub type __priority_which_t = ::c_uint;
|
2 | 2 |
|
| 3 | +s_no_extra_traits! { |
| 4 | + struct addr_bnd_t { |
| 5 | + lower: *mut ::c_void, |
| 6 | + upper: *mut ::c_void, |
| 7 | + } |
| 8 | + |
| 9 | + union sigfault_t_anonymous_union { |
| 10 | + addr_bnd: addr_bnd_t, |
| 11 | + pkey: u32, |
| 12 | + } |
| 13 | + |
| 14 | + struct sigfault_t { |
| 15 | + addr: *mut ::c_void, |
| 16 | + #[cfg(target_arch = "sparc")] |
| 17 | + trapno: ::c_int, |
| 18 | + addr_lsb: ::c_short, |
| 19 | + anonymous_union: sigfault_t_anonymous_union, |
| 20 | + } |
| 21 | + |
| 22 | + union sifields_t { |
| 23 | + _pad: [::c_int; 29], |
| 24 | + sigfault: sigfault_t, |
| 25 | + } |
| 26 | +} |
| 27 | + |
| 28 | +s_no_extra_traits! { |
| 29 | + pub struct siginfo_t { |
| 30 | + pub si_signo: ::c_int, |
| 31 | + pub si_errno: ::c_int, |
| 32 | + pub si_code: ::c_int, |
| 33 | + sifields: sifields_t, |
| 34 | + #[cfg(target_arch = "x86_64")] |
| 35 | + _align: [u64; 0], |
| 36 | + #[cfg(not(target_arch = "x86_64"))] |
| 37 | + _align: [usize; 0], |
| 38 | + } |
| 39 | +} |
| 40 | + |
| 41 | +impl ::fmt::Debug for sigfault_t_anonymous_union { |
| 42 | + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { |
| 43 | + // TODO: no idea how to tell which of the members is used |
| 44 | + f.debug_struct("sigfault_t_anonymous_union") |
| 45 | + .finish() |
| 46 | + } |
| 47 | +} |
| 48 | + |
| 49 | +impl ::fmt::Debug for sigfault_t { |
| 50 | + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { |
| 51 | + // TODO: include trapno on Sparc |
| 52 | + f.debug_struct("sigfault_t") |
| 53 | + .field("addr", &self.addr) |
| 54 | + .field("addr_lsb", &self.addr_lsb) |
| 55 | + .field("anonymous_union", &self.anonymous_union) |
| 56 | + .finish() |
| 57 | + } |
| 58 | +} |
| 59 | + |
| 60 | +impl ::fmt::Debug for sifields_t { |
| 61 | + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { |
| 62 | + // No way to print anything more detailed without the discriminant from |
| 63 | + // siginfo_t |
| 64 | + f.debug_struct("sifields_t").finish() |
| 65 | + } |
| 66 | +} |
| 67 | + |
| 68 | +impl siginfo_t { |
| 69 | + pub unsafe fn si_addr(&self) -> *mut ::c_void { |
| 70 | + self.sifields.sigfault.addr |
| 71 | + } |
| 72 | +} |
| 73 | + |
| 74 | +impl ::fmt::Debug for siginfo_t { |
| 75 | + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { |
| 76 | + // TODO: include fields from sifields |
| 77 | + f.debug_struct("siginfo_t") |
| 78 | + .field("si_signo", &self.si_signo) |
| 79 | + .field("si_errno", &self.si_errno) |
| 80 | + .field("si_code", &self.si_code) |
| 81 | + .finish() |
| 82 | + } |
| 83 | +} |
| 84 | + |
3 | 85 | s! {
|
4 | 86 | pub struct aiocb {
|
5 | 87 | pub aio_fildes: ::c_int,
|
|
44 | 126 | pub ss_size: ::size_t
|
45 | 127 | }
|
46 | 128 |
|
47 |
| - pub struct siginfo_t { |
48 |
| - pub si_signo: ::c_int, |
49 |
| - pub si_errno: ::c_int, |
50 |
| - pub si_code: ::c_int, |
51 |
| - pub _pad: [::c_int; 29], |
52 |
| - #[cfg(target_arch = "x86_64")] |
53 |
| - _align: [u64; 0], |
54 |
| - #[cfg(not(target_arch = "x86_64"))] |
55 |
| - _align: [usize; 0], |
56 |
| - } |
57 |
| - |
58 | 129 | pub struct glob64_t {
|
59 | 130 | pub gl_pathc: ::size_t,
|
60 | 131 | pub gl_pathv: *mut *mut ::c_char,
|
|
0 commit comments