diff options
| author | bors <bors@rust-lang.org> | 2022-12-14 19:14:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-12-14 19:14:39 +0000 |
| commit | b70baa4f922a1809d79caeaeb902800c3be283b9 (patch) | |
| tree | 5a0604d612b44709a6ad083a1d975ae29b526252 /library/std/src/sys/unix/stack_overflow.rs | |
| parent | fbf8b937b44d39ba03835b82ed7ea443321eb7c7 (diff) | |
| parent | 3069bc0c14a79721bb73a4174620cee2aa27382d (diff) | |
| download | rust-b70baa4f922a1809d79caeaeb902800c3be283b9.tar.gz rust-b70baa4f922a1809d79caeaeb902800c3be283b9.zip | |
Auto merge of #105703 - matthiaskrgr:rollup-tfpeam2, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #105399 (Use more LFS functions.) - #105578 (Fix transmutes between pointers in different address spaces (e.g. fn ptrs on AVR)) - #105598 (explain mem::forget(env_lock) in fork/exec) - #105624 (Fix unsoundness in bootstrap cache code) - #105630 (Add a test for #92481) - #105684 (Improve rustdoc markdown variable naming) - #105697 (Remove fee1-dead from reviewers) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
| -rw-r--r-- | library/std/src/sys/unix/stack_overflow.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/library/std/src/sys/unix/stack_overflow.rs b/library/std/src/sys/unix/stack_overflow.rs index 75a5c0f9279..957e086798f 100644 --- a/library/std/src/sys/unix/stack_overflow.rs +++ b/library/std/src/sys/unix/stack_overflow.rs @@ -45,7 +45,10 @@ mod imp { use crate::thread; use libc::MAP_FAILED; - use libc::{mmap, munmap}; + #[cfg(not(target_os = "linux"))] + use libc::{mmap as mmap64, munmap}; + #[cfg(target_os = "linux")] + use libc::{mmap64, munmap}; use libc::{sigaction, sighandler_t, SA_ONSTACK, SA_SIGINFO, SIGBUS, SIG_DFL}; use libc::{sigaltstack, SIGSTKSZ, SS_DISABLE}; use libc::{MAP_ANON, MAP_PRIVATE, PROT_NONE, PROT_READ, PROT_WRITE, SIGSEGV}; @@ -135,7 +138,7 @@ mod imp { #[cfg(not(any(target_os = "openbsd", target_os = "netbsd", target_os = "linux",)))] let flags = MAP_PRIVATE | MAP_ANON; let stackp = - mmap(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); if stackp == MAP_FAILED { panic!("failed to allocate an alternative stack: {}", io::Error::last_os_error()); } |
