about summary refs log tree commit diff
path: root/library/std/src/sys/unix
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-10-25 11:01:24 +0000
committerbors <bors@rust-lang.org>2023-10-25 11:01:24 +0000
commiteb03d40a9c946bbf57c655ed7d26dc44416ca4ad (patch)
tree32bace4a32879af912ab8fa74baaed7c866a23fa /library/std/src/sys/unix
parentc2ef35161fc7477b38f2e556be2fd6d85d9f4905 (diff)
parent1d3d5aaa881bec2206d306a3cf68c8ffdaabcd22 (diff)
downloadrust-eb03d40a9c946bbf57c655ed7d26dc44416ca4ad.tar.gz
rust-eb03d40a9c946bbf57c655ed7d26dc44416ca4ad.zip
Auto merge of #117102 - devnexen:dfbsd_stack_overflow_upd, r=thomcc
stack_overflow: get_stackp using MAP_STACK flag on dragonflybsd too.
Diffstat (limited to 'library/std/src/sys/unix')
-rw-r--r--library/std/src/sys/unix/stack_overflow.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/library/std/src/sys/unix/stack_overflow.rs b/library/std/src/sys/unix/stack_overflow.rs
index 73c530786b2..3dbab4cc486 100644
--- a/library/std/src/sys/unix/stack_overflow.rs
+++ b/library/std/src/sys/unix/stack_overflow.rs
@@ -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);