Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c13d2ec7 authored by Tao Bao's avatar Tao Bao
Browse files

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
parent abade5af
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ cc_library_static {
    ],

    cflags: [
        "-D_FILE_OFFSET_BITS=64",
        "-Werror",
        "-Wall",
    ],
+3 −3
Original line number Diff line number Diff line
@@ -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<off64_t>(start) * blksize);
    void* range_start = mmap(next, range_size, PROT_READ, MAP_PRIVATE | MAP_FIXED, fd,
                             static_cast<off_t>(start) * blksize);
    if (range_start == MAP_FAILED) {
      PLOG(ERROR) << "failed to map range " << i << ": " << line;
      success = false;