diff options
author | Christopher Ferris <cferris@google.com> | 2020-05-06 13:48:32 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2020-05-07 17:45:30 -0700 |
commit | de38b1a356add7b6cf863fe1b8d707525aca59cd (patch) | |
tree | a897ed1b9ae0c2b0d2e7e98b56be583bf2191448 /libutils/FileMap.cpp | |
parent | 1cf1238d4a1ac2407c92b6790eb6df6d979fe2fa (diff) |
Change call to mmap64.
The code was using an off64_t but calling mmap. This caused the code
to abort on 32 bit.
Add a unit test that would abort on the previous version.
Bug: 155662887
Test: New unit test passes.
Change-Id: I7a6efbc0d4227403c3d08a08deea56f239382157
Merged-In: I7a6efbc0d4227403c3d08a08deea56f239382157
(cherry picked from commit 7b9f35c9de53352f915c5b5e8eb39dab09356c19)
Diffstat (limited to 'libutils/FileMap.cpp')
-rw-r--r-- | libutils/FileMap.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libutils/FileMap.cpp b/libutils/FileMap.cpp index 1202c156d..1d899ab7f 100644 --- a/libutils/FileMap.cpp +++ b/libutils/FileMap.cpp @@ -195,7 +195,7 @@ bool FileMap::create(const char* origFileName, int fd, off64_t offset, size_t le int prot = PROT_READ; if (!readOnly) prot |= PROT_WRITE; - void* ptr = mmap(nullptr, adjLength, prot, flags, fd, adjOffset); + void* ptr = mmap64(nullptr, adjLength, prot, flags, fd, adjOffset); if (ptr == MAP_FAILED) { if (errno == EINVAL && length == 0) { ptr = nullptr; |