Skip to content

Commit

Permalink
Merge pull request #501 from mikebenfield/lfs
Browse files Browse the repository at this point in the history
Use mmap64 on Linux.
  • Loading branch information
workingjubilee committed Jun 21, 2023
2 parents 4e4b7ac + 062e784 commit 2eaa602
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/symbolize/gimli/mmap_unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ use core::ops::Deref;
use core::ptr;
use core::slice;

#[cfg(not(all(target_os = "linux", target_env = "gnu")))]
use libc::mmap as mmap64;
#[cfg(all(target_os = "linux", target_env = "gnu"))]
use libc::mmap64;

pub struct Mmap {
ptr: *mut libc::c_void,
len: usize,
}

impl Mmap {
pub unsafe fn map(file: &File, len: usize) -> Option<Mmap> {
let ptr = libc::mmap(
let ptr = mmap64(
ptr::null_mut(),
len,
libc::PROT_READ,
Expand Down

0 comments on commit 2eaa602

Please sign in to comment.