stack_overflow: get_stackp using MAP_STACK flag on dragonflybsd too.
This commit is contained in:
parent
e2068cdb09
commit
1d3d5aaa88
@ -134,9 +134,19 @@ mod imp {
|
|||||||
// OpenBSD requires this flag for stack mapping
|
// OpenBSD requires this flag for stack mapping
|
||||||
// otherwise the said mapping will fail as a no-op on most systems
|
// otherwise the said mapping will fail as a no-op on most systems
|
||||||
// and has a different meaning on FreeBSD
|
// 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;
|
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 flags = MAP_PRIVATE | MAP_ANON;
|
||||||
let stackp =
|
let stackp =
|
||||||
mmap64(ptr::null_mut(), SIGSTKSZ + page_size(), PROT_READ | PROT_WRITE, flags, -1, 0);
|
mmap64(ptr::null_mut(), SIGSTKSZ + page_size(), PROT_READ | PROT_WRITE, flags, -1, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user