diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index f399f27c..ad9959a1 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -1,3 +1,4 @@ +pub type c_char = i8; pub type clock_t = u64; pub type ino_t = u64; pub type lwpid_t = i32; diff --git a/src/unix/bsd/freebsdlike/freebsd/aarch64.rs b/src/unix/bsd/freebsdlike/freebsd/aarch64.rs index 3d61f889..7f4ed895 100644 --- a/src/unix/bsd/freebsdlike/freebsd/aarch64.rs +++ b/src/unix/bsd/freebsdlike/freebsd/aarch64.rs @@ -1,3 +1,4 @@ +pub type c_char = u8; pub type c_long = i64; pub type c_ulong = u64; pub type time_t = i64; @@ -29,4 +30,5 @@ s! { } } +pub const __MINSIGSTKSZ: ::size_t = 1024 * 4; pub const MAP_32BIT: ::c_int = 0x00080000; diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index a2a6d693..d7be64ea 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -161,10 +161,11 @@ s! { pub const SIGEV_THREAD_ID: ::c_int = 4; +pub const MINSIGSTKSZ: ::size_t = __MINSIGSTKSZ; pub const RAND_MAX: ::c_int = 0x7fff_fffd; -pub const PTHREAD_STACK_MIN: ::size_t = 2048; +pub const PTHREAD_STACK_MIN: ::size_t = MINSIGSTKSZ; pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 4; -pub const SIGSTKSZ: ::size_t = 34816; +pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + 32768; pub const SF_NODISKIO: ::c_int = 0x00000001; pub const SF_MNOWAIT: ::c_int = 0x00000002; pub const SF_SYNC: ::c_int = 0x00000004; diff --git a/src/unix/bsd/freebsdlike/freebsd/x86.rs b/src/unix/bsd/freebsdlike/freebsd/x86.rs index 8a5e5f9f..ba98f91c 100644 --- a/src/unix/bsd/freebsdlike/freebsd/x86.rs +++ b/src/unix/bsd/freebsdlike/freebsd/x86.rs @@ -1,3 +1,4 @@ +pub type c_char = i8; pub type c_long = i32; pub type c_ulong = u32; pub type time_t = i32; @@ -29,3 +30,5 @@ s! { __unused: [u8; 8], } } + +pub const __MINSIGSTKSZ: ::size_t = 512 * 4; diff --git a/src/unix/bsd/freebsdlike/freebsd/x86_64.rs b/src/unix/bsd/freebsdlike/freebsd/x86_64.rs index 3d61f889..106ad897 100644 --- a/src/unix/bsd/freebsdlike/freebsd/x86_64.rs +++ b/src/unix/bsd/freebsdlike/freebsd/x86_64.rs @@ -1,3 +1,4 @@ +pub type c_char = i8; pub type c_long = i64; pub type c_ulong = u64; pub type time_t = i64; @@ -29,4 +30,5 @@ s! { } } +pub const __MINSIGSTKSZ: ::size_t = 512 * 4; pub const MAP_32BIT: ::c_int = 0x00080000; diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index b3922426..76f42990 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -1,4 +1,3 @@ -pub type c_char = i8; pub type dev_t = u32; pub type mode_t = u16; pub type pthread_attr_t = *mut ::c_void; @@ -84,7 +83,10 @@ s! { pub struct stack_t { // In FreeBSD 11 and later, ss_sp is actually a void* + #[cfg(not(target_arch = "aarch64"))] pub ss_sp: *mut ::c_char, + #[cfg(target_arch = "aarch64")] + pub ss_sp: *mut ::c_void, pub ss_size: ::size_t, pub ss_flags: ::c_int, }