diff --git a/src/symbolize/gimli/mmap_unix.rs b/src/symbolize/gimli/mmap_unix.rs index 5806c9f7e..b16f2acea 100644 --- a/src/symbolize/gimli/mmap_unix.rs +++ b/src/symbolize/gimli/mmap_unix.rs @@ -4,6 +4,11 @@ use core::ops::Deref; use core::ptr; use core::slice; +#[cfg(not(target_os = "linux"))] +use libc::mmap as mmap64; +#[cfg(target_os = "linux")] +use libc::mmap64; + pub struct Mmap { ptr: *mut libc::c_void, len: usize, @@ -11,7 +16,7 @@ pub struct Mmap { impl Mmap { pub unsafe fn map(file: &File, len: usize) -> Option { - let ptr = libc::mmap( + let ptr = mmap64( ptr::null_mut(), len, libc::PROT_READ,