From c13d2ec7726bae1a6ec0d29c4b4ed54ac46149a1 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Tue, 10 Oct 2017 10:56:09 -0700 Subject: otautil: Fix mac build. bootable/recovery/otautil/SysUtil.cpp:103:19: error: use of undeclared identifier 'mmap64'; did you mean 'mmap'? void* reserve = mmap64(nullptr, blocks * blksize, PROT_NONE, MAP_PRIVATE | MAP_ANON, -1, 0); ^~~~~~ Test: mmma bootable/recovery Change-Id: I22d7dc4d994069201e5a633cec21421e2c4182fa --- otautil/Android.bp | 1 + otautil/SysUtil.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/otautil/Android.bp b/otautil/Android.bp index 5905ba649..659fefada 100644 --- a/otautil/Android.bp +++ b/otautil/Android.bp @@ -29,6 +29,7 @@ cc_library_static { ], cflags: [ + "-D_FILE_OFFSET_BITS=64", "-Werror", "-Wall", ], diff --git a/otautil/SysUtil.cpp b/otautil/SysUtil.cpp index d54a824d2..0655c4778 100644 --- a/otautil/SysUtil.cpp +++ b/otautil/SysUtil.cpp @@ -100,7 +100,7 @@ bool MemMapping::MapBlockFile(const std::string& filename) { } // Reserve enough contiguous address space for the whole file. - void* reserve = mmap64(nullptr, blocks * blksize, PROT_NONE, MAP_PRIVATE | MAP_ANON, -1, 0); + void* reserve = mmap(nullptr, blocks * blksize, PROT_NONE, MAP_PRIVATE | MAP_ANON, -1, 0); if (reserve == MAP_FAILED) { PLOG(ERROR) << "failed to reserve address space"; return false; @@ -135,8 +135,8 @@ bool MemMapping::MapBlockFile(const std::string& filename) { break; } - void* range_start = mmap64(next, range_size, PROT_READ, MAP_PRIVATE | MAP_FIXED, fd, - static_cast(start) * blksize); + void* range_start = mmap(next, range_size, PROT_READ, MAP_PRIVATE | MAP_FIXED, fd, + static_cast(start) * blksize); if (range_start == MAP_FAILED) { PLOG(ERROR) << "failed to map range " << i << ": " << line; success = false; -- cgit v1.2.3