summaryrefslogtreecommitdiffstats
path: root/libutils/FileMap.cpp
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2015-02-20 16:40:32 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-02-20 16:40:33 +0000
commit1158c7d5fe7086b42f70a81381558f35b6cd27a9 (patch)
tree8f36b38029fb8e3e5ace4b86980eef82363cfd47 /libutils/FileMap.cpp
parent623eebe68f3c6c9e54cf5b186696052d2948410c (diff)
parent5955a9f5e4dee9fdcad113943771e8f9a2138748 (diff)
downloadsystem_core-1158c7d5fe7086b42f70a81381558f35b6cd27a9.tar.gz
system_core-1158c7d5fe7086b42f70a81381558f35b6cd27a9.tar.bz2
system_core-1158c7d5fe7086b42f70a81381558f35b6cd27a9.zip
Merge "Remove reference to NOT_USING_KLIBC and cygwin."
Diffstat (limited to 'libutils/FileMap.cpp')
-rw-r--r--libutils/FileMap.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/libutils/FileMap.cpp b/libutils/FileMap.cpp
index f49b4f94c..0af066f8b 100644
--- a/libutils/FileMap.cpp
+++ b/libutils/FileMap.cpp
@@ -141,20 +141,14 @@ bool FileMap::create(const char* origFileName, int fd, off64_t offset, size_t le
// init on first use
if (mPageSize == -1) {
-#if NOT_USING_KLIBC
mPageSize = sysconf(_SC_PAGESIZE);
if (mPageSize == -1) {
ALOGE("could not get _SC_PAGESIZE\n");
return false;
}
-#else
- // this holds for Linux, Darwin, Cygwin, and doesn't pain the ARM
- mPageSize = 4096;
-#endif
}
- adjust = offset % mPageSize;
-try_again:
+ adjust = offset % mPageSize;
adjOffset = offset - adjust;
adjLength = length + adjust;
@@ -165,13 +159,6 @@ try_again:
ptr = mmap(NULL, adjLength, prot, flags, fd, adjOffset);
if (ptr == MAP_FAILED) {
- // Cygwin does not seem to like file mapping files from an offset.
- // So if we fail, try again with offset zero
- if (adjOffset > 0) {
- adjust = offset;
- goto try_again;
- }
-
ALOGE("mmap(%lld,%zu) failed: %s\n",
(long long)adjOffset, adjLength, strerror(errno));
return false;