diff options
| author | bors <bors@rust-lang.org> | 2022-12-16 13:20:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-12-16 13:20:14 +0000 |
| commit | e82a604a88fec3adc0645c5cc5328ea7eba5faa4 (patch) | |
| tree | aafe13e8c6822c8d03d987868bc131ded4421746 /library/std/src/sys/unix/stack_overflow.rs | |
| parent | 789313267d2f814ec0bf1861d6e22e678668e998 (diff) | |
| parent | 39bb865759dcf2cd6c5f3cf84fc1c11b2c71e7b0 (diff) | |
| download | rust-e82a604a88fec3adc0645c5cc5328ea7eba5faa4.tar.gz rust-e82a604a88fec3adc0645c5cc5328ea7eba5faa4.zip | |
Auto merge of #2731 - RalfJung:rustup, r=RalfJung
Rustup
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()); } |
