Skip to content

Commit

Permalink
Auto merge of #117102 - devnexen:dfbsd_stack_overflow_upd, r=thomcc
Browse files Browse the repository at this point in the history
stack_overflow: get_stackp using MAP_STACK flag on dragonflybsd too.
  • Loading branch information
bors committed Oct 25, 2023
2 parents c2ef351 + 1d3d5aa commit eb03d40
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions library/std/src/sys/unix/stack_overflow.rs
Original file line number Diff line number Diff line change
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

0 comments on commit eb03d40

Please sign in to comment.