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
diff --git a/libutils/FileMap.cpp b/libutils/FileMap.cpp
index 1202c15..1d899ab 100644
--- a/libutils/FileMap.cpp
+++ b/libutils/FileMap.cpp
@@ -195,7 +195,7 @@
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;