about summary refs log tree commit diff
path: root/library/std/src/sys/unix
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-13 14:59:39 +0000
committerbors <bors@rust-lang.org>2022-10-13 14:59:39 +0000
commit6b3ede3f7bc502eba7bbd202b4b9312d812adcd7 (patch)
tree44edbc5c1be113234c8a472094690e024eea298a /library/std/src/sys/unix
parent4891d57f7aab37b5d6a84f2901c0bb8903111d53 (diff)
parent0f12b40bff417f0e5b83df8f8213e0886c61101f (diff)
downloadrust-6b3ede3f7bc502eba7bbd202b4b9312d812adcd7.tar.gz
rust-6b3ede3f7bc502eba7bbd202b4b9312d812adcd7.zip
Auto merge of #103009 - Dylan-DPC:rollup-9c2tng6, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #102765 (Suggest `==` to the first expr which has `ExprKind::Assign` kind)
 - #102854 (openbsd: don't reallocate a guard page on the stack.)
 - #102904 (Print return-position `impl Trait` in trait verbosely if `-Zverbose`)
 - #102947 (Sort elaborated existential predicates in `object_ty_for_trait`)
 - #102956 (Use `full_res` instead of `expect_full_res`)
 - #102999 (Delay `is_intrinsic` query until after we've determined the callee is a function)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/sys/unix')
-rw-r--r--library/std/src/sys/unix/thread.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/library/std/src/sys/unix/thread.rs b/library/std/src/sys/unix/thread.rs
index 7df4add8ce1..42ac6fcd8bf 100644
--- a/library/std/src/sys/unix/thread.rs
+++ b/library/std/src/sys/unix/thread.rs
@@ -766,6 +766,16 @@ pub mod guard {
             const GUARD_PAGES: usize = 1;
             let guard = guardaddr..guardaddr + GUARD_PAGES * page_size;
             Some(guard)
+        } else if cfg!(target_os = "openbsd") {
+            // OpenBSD stack already includes a guard page, and stack is
+            // immutable.
+            //
+            // We'll just note where we expect rlimit to start
+            // faulting, so our handler can report "stack overflow", and
+            // trust that the kernel's own stack guard will work.
+            let stackptr = get_stack_start_aligned()?;
+            let stackaddr = stackptr.addr();
+            Some(stackaddr - page_size..stackaddr)
         } else {
             // Reallocate the last page of the stack.
             // This ensures SIGBUS will be raised on