Skip to content

Commit 0978c27

Browse files
author
Michael Benfield
committed
Use mmap64 on Linux.
mmap is a non-LFS function and due to its usage here will appear in binaries produced by rustc. This is relevant to rust-lang/rust#94173.
1 parent 5be2e8b commit 0978c27

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/symbolize/gimli/mmap_unix.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@ use core::ops::Deref;
44
use core::ptr;
55
use core::slice;
66

7+
#[cfg(not(target_os = "linux"))]
8+
use libc::mmap as mmap64;
9+
#[cfg(target_os = "linux")]
10+
use libc::mmap64;
11+
712
pub struct Mmap {
813
ptr: *mut libc::c_void,
914
len: usize,
1015
}
1116

1217
impl Mmap {
1318
pub unsafe fn map(file: &File, len: usize) -> Option<Mmap> {
14-
let ptr = libc::mmap(
19+
let ptr = mmap64(
1520
ptr::null_mut(),
1621
len,
1722
libc::PROT_READ,

0 commit comments

Comments
 (0)