Skip to content

Commit 9300e78

Browse files
committed
FreeBSD: fix SIGSTKSZ on arm/aarch64 / add MINSIGSTKSZ
1 parent 6802901 commit 9300e78

File tree

6 files changed

+12
-2
lines changed

6 files changed

+12
-2
lines changed

src/unix/bsd/freebsdlike/freebsd/aarch64.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ pub type time_t = i64;
55
pub type suseconds_t = i64;
66
pub type register_t = i64;
77

8+
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
9+
810
pub const _MC_FP_VALID: ::c_int = 0x1;
911

1012
s! {

src/unix/bsd/freebsdlike/freebsd/arm.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ pub type time_t = i64;
55
pub type suseconds_t = i32;
66
pub type register_t = i32;
77

8+
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
9+
810
s! {
911
pub struct stat {
1012
pub st_dev: ::dev_t,

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,9 @@ pub const EXTATTR_NAMESPACE_USER: ::c_int = 1;
325325
pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2;
326326

327327
pub const RAND_MAX: ::c_int = 0x7fff_fffd;
328-
pub const PTHREAD_STACK_MIN: ::size_t = 2048;
328+
pub const PTHREAD_STACK_MIN: ::size_t = MINSIGSTKSZ;
329329
pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 4;
330-
pub const SIGSTKSZ: ::size_t = 34816;
330+
pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + 32768;
331331
pub const SF_NODISKIO: ::c_int = 0x00000001;
332332
pub const SF_MNOWAIT: ::c_int = 0x00000002;
333333
pub const SF_SYNC: ::c_int = 0x00000004;

src/unix/bsd/freebsdlike/freebsd/powerpc64.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ pub type time_t = i64;
55
pub type suseconds_t = i64;
66
pub type register_t = i64;
77

8+
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
9+
810
s! {
911
pub struct stat {
1012
pub st_dev: ::dev_t,

src/unix/bsd/freebsdlike/freebsd/x86.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ pub type time_t = i32;
55
pub type suseconds_t = i32;
66
pub type register_t = i32;
77

8+
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
9+
810
s! {
911
pub struct stat {
1012
pub st_dev: ::dev_t,

src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ pub type time_t = i64;
55
pub type suseconds_t = i64;
66
pub type register_t = i64;
77

8+
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
9+
810
// should be pub(crate), but that requires Rust 1.18.0
911
cfg_if! {
1012
if #[cfg(libc_const_size_of)] {

0 commit comments

Comments
 (0)