From c47a8bb17940508d63aae13c49131f8af185dc99 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Mon, 23 Oct 2023 22:00:13 +0100 Subject: [PATCH] stack_overflow: get_stackp using MAP_STACK flag on dragonflybsd too. --- library/std/src/sys/unix/stack_overflow.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/sys/unix/stack_overflow.rs b/library/std/src/sys/unix/stack_overflow.rs index 73c530786b2fe..ef7b39f63af45 100644 --- a/library/std/src/sys/unix/stack_overflow.rs +++ b/library/std/src/sys/unix/stack_overflow.rs @@ -134,9 +134,9 @@ 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);