Skip to content

Commit a3b520f

Browse files
authored
Fix the value of _NSIGS on sparc. (#149)
Predefine `__WANT_POSIX1B_SIGNALS__` so that the Linux headers define the correct `_NSIGS` value on sparc targets.
1 parent d092eb8 commit a3b520f

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

gen/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ fn run_bindgen(
337337
.blocklist_item("__BITS_PER_LONG")
338338
.clang_arg(&format!("--target={}", clang_target))
339339
.clang_arg("-DBITS_PER_LONG=(__SIZEOF_LONG__*__CHAR_BIT__)")
340+
.clang_arg("-D__WANT_POSIX1B_SIGNALS__")
340341
.clang_arg("-nostdinc")
341342
.clang_arg("-I")
342343
.clang_arg(linux_include)

src/sparc/general.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub type __poll_t = crate::ctypes::c_uint;
5252
pub type cap_user_header_t = *mut __user_cap_header_struct;
5353
pub type cap_user_data_t = *mut __user_cap_data_struct;
5454
pub type __kernel_rwf_t = crate::ctypes::c_int;
55-
pub type sigset_t = crate::ctypes::c_ulong;
55+
pub type old_sigset_t = crate::ctypes::c_ulong;
5656
pub type __signalfn_t = ::core::option::Option<unsafe extern "C" fn(arg1: crate::ctypes::c_int)>;
5757
pub type __sighandler_t = __signalfn_t;
5858
pub type __restorefn_t = ::core::option::Option<unsafe extern "C" fn()>;
@@ -552,7 +552,7 @@ pub cgroup: __u64,
552552
}
553553
#[repr(C)]
554554
#[derive(Debug, Copy, Clone)]
555-
pub struct __new_sigset_t {
555+
pub struct sigset_t {
556556
pub sig: [crate::ctypes::c_ulong; 2usize],
557557
}
558558
#[repr(C)]
@@ -563,17 +563,17 @@ pub cur_status: crate::ctypes::c_int,
563563
}
564564
#[repr(C)]
565565
#[derive(Debug, Copy, Clone)]
566-
pub struct __new_sigaction {
566+
pub struct sigaction {
567567
pub sa_handler: __sighandler_t,
568568
pub sa_flags: crate::ctypes::c_ulong,
569569
pub sa_restorer: __sigrestore_t,
570-
pub sa_mask: __new_sigset_t,
570+
pub sa_mask: sigset_t,
571571
}
572572
#[repr(C)]
573573
#[derive(Debug, Copy, Clone)]
574-
pub struct sigaction {
574+
pub struct old_sigaction {
575575
pub sa_handler: __sighandler_t,
576-
pub sa_mask: sigset_t,
576+
pub sa_mask: old_sigset_t,
577577
pub sa_flags: crate::ctypes::c_ulong,
578578
pub sa_restorer: ::core::option::Option<unsafe extern "C" fn()>,
579579
}
@@ -1051,7 +1051,7 @@ pub __bindgen_padding_0: [u8; 3usize],
10511051
#[repr(C)]
10521052
#[derive(Debug, Copy, Clone)]
10531053
pub struct kernel_sigset_t {
1054-
pub sig: [crate::ctypes::c_ulong; 1usize],
1054+
pub sig: [crate::ctypes::c_ulong; 2usize],
10551055
}
10561056
#[repr(C)]
10571057
#[derive(Debug, Copy, Clone)]
@@ -1988,8 +1988,7 @@ pub const _NSIG_BPW: u32 = 32;
19881988
pub const _NSIG_WORDS: u32 = 2;
19891989
pub const SIGRTMIN: u32 = 32;
19901990
pub const SIGRTMAX: u32 = 64;
1991-
pub const _NSIG: u32 = 32;
1992-
pub const NSIG: u32 = 32;
1991+
pub const _NSIG: u32 = 64;
19931992
pub const _SV_SSTACK: u32 = 1;
19941993
pub const _SV_INTR: u32 = 2;
19951994
pub const _SV_RESET: u32 = 4;

src/sparc64/general.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub type __poll_t = crate::ctypes::c_uint;
5454
pub type cap_user_header_t = *mut __user_cap_header_struct;
5555
pub type cap_user_data_t = *mut __user_cap_data_struct;
5656
pub type __kernel_rwf_t = crate::ctypes::c_int;
57-
pub type sigset_t = crate::ctypes::c_ulong;
57+
pub type old_sigset_t = crate::ctypes::c_ulong;
5858
pub type __signalfn_t = ::core::option::Option<unsafe extern "C" fn(arg1: crate::ctypes::c_int)>;
5959
pub type __sighandler_t = __signalfn_t;
6060
pub type __restorefn_t = ::core::option::Option<unsafe extern "C" fn()>;
@@ -554,7 +554,7 @@ pub cgroup: __u64,
554554
}
555555
#[repr(C)]
556556
#[derive(Debug, Copy, Clone)]
557-
pub struct __new_sigset_t {
557+
pub struct sigset_t {
558558
pub sig: [crate::ctypes::c_ulong; 1usize],
559559
}
560560
#[repr(C)]
@@ -565,17 +565,17 @@ pub cur_status: crate::ctypes::c_int,
565565
}
566566
#[repr(C)]
567567
#[derive(Debug, Copy, Clone)]
568-
pub struct __new_sigaction {
568+
pub struct sigaction {
569569
pub sa_handler: __sighandler_t,
570570
pub sa_flags: crate::ctypes::c_ulong,
571571
pub sa_restorer: __sigrestore_t,
572-
pub sa_mask: __new_sigset_t,
572+
pub sa_mask: sigset_t,
573573
}
574574
#[repr(C)]
575575
#[derive(Debug, Copy, Clone)]
576-
pub struct sigaction {
576+
pub struct old_sigaction {
577577
pub sa_handler: __sighandler_t,
578-
pub sa_mask: sigset_t,
578+
pub sa_mask: old_sigset_t,
579579
pub sa_flags: crate::ctypes::c_ulong,
580580
pub sa_restorer: ::core::option::Option<unsafe extern "C" fn()>,
581581
}
@@ -1046,12 +1046,12 @@ pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
10461046
pub __bindgen_padding_0: [u8; 3usize],
10471047
}
10481048
#[repr(C)]
1049-
#[derive(Debug)]
1049+
#[derive(Debug, Copy, Clone)]
10501050
pub struct kernel_sigset_t {
1051-
pub sig: __IncompleteArrayField<crate::ctypes::c_ulong>,
1051+
pub sig: [crate::ctypes::c_ulong; 1usize],
10521052
}
10531053
#[repr(C)]
1054-
#[derive(Debug)]
1054+
#[derive(Debug, Copy, Clone)]
10551055
pub struct kernel_sigaction {
10561056
pub sa_handler_kernel: __kernel_sighandler_t,
10571057
pub sa_flags: crate::ctypes::c_ulong,
@@ -1982,8 +1982,7 @@ pub const _NSIG_BPW: u32 = 64;
19821982
pub const _NSIG_WORDS: u32 = 1;
19831983
pub const SIGRTMIN: u32 = 32;
19841984
pub const SIGRTMAX: u32 = 64;
1985-
pub const _NSIG: u32 = 32;
1986-
pub const NSIG: u32 = 32;
1985+
pub const _NSIG: u32 = 64;
19871986
pub const _SV_SSTACK: u32 = 1;
19881987
pub const _SV_INTR: u32 = 2;
19891988
pub const _SV_RESET: u32 = 4;

0 commit comments

Comments
 (0)