Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack_overflow: get_stackp using MAP_STACK flag on dragonflybsd too. #117102

Merged
merged 1 commit into from Oct 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions library/std/src/sys/unix/stack_overflow.rs
Expand Up @@ -134,9 +134,19 @@ mod imp {
// OpenBSD requires this flag for stack mapping
// otherwise the said mapping will fail as a no-op on most systems
// and has a different meaning on FreeBSD
#[cfg(any(target_os = "openbsd", target_os = "netbsd", target_os = "linux",))]
#[cfg(any(
target_os = "openbsd",
target_os = "netbsd",
target_os = "linux",
target_os = "dragonfly",
))]
let flags = MAP_PRIVATE | MAP_ANON | libc::MAP_STACK;
#[cfg(not(any(target_os = "openbsd", target_os = "netbsd", target_os = "linux",)))]
#[cfg(not(any(
target_os = "openbsd",
target_os = "netbsd",
target_os = "linux",
target_os = "dragonfly",
)))]
let flags = MAP_PRIVATE | MAP_ANON;
let stackp =
mmap64(ptr::null_mut(), SIGSTKSZ + page_size(), PROT_READ | PROT_WRITE, flags, -1, 0);
Expand Down