]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/sys/unix/thread.rs
Preparing for merge from rustc
[rust.git] / library / std / src / sys / unix / thread.rs
index 6ecf5bdcf86d2bf792695eb1720f3c10c403eadf..d454a2a717c0639a326555d3dc8b21a60450b1dd 100644 (file)
@@ -653,7 +653,10 @@ pub unsafe fn init() -> Option<Guard> {
 ))]
 #[cfg_attr(test, allow(dead_code))]
 pub mod guard {
-    use libc::{mmap, mprotect};
+    #[cfg(not(target_os = "linux"))]
+    use libc::{mmap as mmap64, mprotect};
+    #[cfg(target_os = "linux")]
+    use libc::{mmap64, mprotect};
     use libc::{MAP_ANON, MAP_FAILED, MAP_FIXED, MAP_PRIVATE, PROT_NONE, PROT_READ, PROT_WRITE};
 
     use crate::io;
@@ -803,7 +806,7 @@ pub unsafe fn init() -> Option<Guard> {
             // read/write permissions and only then mprotect() it to
             // no permissions at all. See issue #50313.
             let stackptr = get_stack_start_aligned()?;
-            let result = mmap(
+            let result = mmap64(
                 stackptr,
                 page_size,
                 PROT_READ | PROT_WRITE,