diff options
| author | Christopher Ferris <cferris@google.com> | 2020-05-06 13:48:32 -0700 |
|---|---|---|
| committer | Christopher Ferris <cferris@google.com> | 2020-05-06 22:32:18 +0000 |
| commit | 0f4ea84b410f859308679e91abb9f2e52de50c0f (patch) | |
| tree | 58dd62154264bdd9a1e77e6d8fb28f23f334fabd /libutils/FileMap.cpp | |
| parent | 619553929e92429e68e53be840afed8c82b2b4f1 (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
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 1202c156df..1d899ab7fc 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; |
