Skip to content

Commit 45e7b8b

Browse files
committed
FreeBSD: fix SIGSTKSZ on arm/aarch64 / add MINSIGSTKSZ
1 parent e9a75dd commit 45e7b8b

File tree

6 files changed

+7
-2
lines changed

6 files changed

+7
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ cfg_if! {
1616
}
1717

1818
pub const MAP_32BIT: ::c_int = 0x00080000;
19+
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ cfg_if! {
4545
}
4646
}
4747
pub const MAP_32BIT: ::c_int = 0x00080000;
48+
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4

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

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

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ cfg_if! {
4242
}
4343

4444
pub const MAP_32BIT: ::c_int = 0x00080000;
45+
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ cfg_if! {
4141
pub const _ALIGNBYTES: usize = 8 - 1;
4242
}
4343
}
44+
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ cfg_if! {
185185
}
186186
}
187187
pub const MAP_32BIT: ::c_int = 0x00080000;
188+
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
188189

189190
cfg_if! {
190191
if #[cfg(libc_align)] {

0 commit comments

Comments
 (0)