Skip to content

Commit 1d3d5aa

Browse files
committed
stack_overflow: get_stackp using MAP_STACK flag on dragonflybsd too.
1 parent e2068cd commit 1d3d5aa

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

library/std/src/sys/unix/stack_overflow.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,19 @@ mod imp {
134134
// OpenBSD requires this flag for stack mapping
135135
// otherwise the said mapping will fail as a no-op on most systems
136136
// and has a different meaning on FreeBSD
137-
#[cfg(any(target_os = "openbsd", target_os = "netbsd", target_os = "linux",))]
137+
#[cfg(any(
138+
target_os = "openbsd",
139+
target_os = "netbsd",
140+
target_os = "linux",
141+
target_os = "dragonfly",
142+
))]
138143
let flags = MAP_PRIVATE | MAP_ANON | libc::MAP_STACK;
139-
#[cfg(not(any(target_os = "openbsd", target_os = "netbsd", target_os = "linux",)))]
144+
#[cfg(not(any(
145+
target_os = "openbsd",
146+
target_os = "netbsd",
147+
target_os = "linux",
148+
target_os = "dragonfly",
149+
)))]
140150
let flags = MAP_PRIVATE | MAP_ANON;
141151
let stackp =
142152
mmap64(ptr::null_mut(), SIGSTKSZ + page_size(), PROT_READ | PROT_WRITE, flags, -1, 0);

0 commit comments

Comments
 (0)