Skip to content

Commit 3311ba8

Browse files
committed
openbsd: introduce _MAX_PAGE_SHIFT to compute PTHREAD_STACK_MIN, MINSIGSTKSZ, and SIGSTKSZ
1 parent 37f8f8d commit 3311ba8

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

src/unix/bsd/netbsdlike/openbsd/aarch64.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ cfg_if! {
1212
pub const _ALIGNBYTES: usize = 8 - 1;
1313
}
1414
}
15+
16+
pub const _MAX_PAGE_SHIFT: u32 = 12;

src/unix/bsd/netbsdlike/openbsd/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,8 +1297,9 @@ pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
12971297
pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
12981298
pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
12991299

1300-
pub const PTHREAD_STACK_MIN : ::size_t = 4096;
1301-
pub const SIGSTKSZ : ::size_t = 28672;
1300+
pub const PTHREAD_STACK_MIN: ::size_t = (1_usize << _MAX_PAGE_SHIFT);
1301+
pub const MINSIGSTKSZ: ::size_t = (3_usize << _MAX_PAGE_SHIFT);
1302+
pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + (1_usize << _MAX_PAGE_SHIFT) * 4;
13021303

13031304
pub const PT_FIRSTMACH: ::c_int = 32;
13041305

src/unix/bsd/netbsdlike/openbsd/x86.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ cfg_if! {
1212
pub const _ALIGNBYTES: usize = 4 - 1;
1313
}
1414
}
15+
16+
pub const _MAX_PAGE_SHIFT: u32 = 12;

src/unix/bsd/netbsdlike/openbsd/x86_64.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ cfg_if! {
1515
}
1616
}
1717

18+
pub const _MAX_PAGE_SHIFT: u32 = 12;
19+
1820
pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0;
1921
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
2022
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;

0 commit comments

Comments
 (0)