Skip to content

Commit f70ff55

Browse files
committed
FreeBSD: fix SIGSTKSZ on arm/aarch64 / add MINSIGSTKSZ
1 parent da7c062 commit f70ff55

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
@@ -334,9 +334,9 @@ pub const EXTATTR_NAMESPACE_USER: ::c_int = 1;
334334
pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2;
335335

336336
pub const RAND_MAX: ::c_int = 0x7fff_fffd;
337-
pub const PTHREAD_STACK_MIN: ::size_t = 2048;
337+
pub const PTHREAD_STACK_MIN: ::size_t = MINSIGSTKSZ;
338338
pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 4;
339-
pub const SIGSTKSZ: ::size_t = 34816;
339+
pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + 32768;
340340
pub const SF_NODISKIO: ::c_int = 0x00000001;
341341
pub const SF_MNOWAIT: ::c_int = 0x00000002;
342342
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)