diff options
author | Kenny Root <kroot@google.com> | 2010-11-24 12:56:06 -0800 |
---|---|---|
committer | Alex Ray <aray@google.com> | 2013-07-30 13:56:55 -0700 |
commit | e2fa7dc58eaf34f30b89350d143d97fd4a501199 (patch) | |
tree | 34ffbf4a781908c261dba8559aa160ff937030f4 /include/utils/FileMap.h | |
parent | 1d618d63c1bb99728b5b0afe320f5a6afa95436c (diff) | |
download | system_core-e2fa7dc58eaf34f30b89350d143d97fd4a501199.zip system_core-e2fa7dc58eaf34f30b89350d143d97fd4a501199.tar.gz system_core-e2fa7dc58eaf34f30b89350d143d97fd4a501199.tar.bz2 |
Change assets to use 64-bit API
The asset system and supporting libraries were using off_t instead of
off64_t to access files larger than 2GB (32-bit signed). This change
replaces all off_t with off64_t and lseek64.
There is a new utils/Compat.h added for Mac OS compatibility.
Also fixed some size-related compiler warnings.
Bug: 3205336
Change-Id: I9097b3cb7a602e811fe52f245939d8975da55e9e
Diffstat (limited to 'include/utils/FileMap.h')
-rw-r--r-- | include/utils/FileMap.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/utils/FileMap.h b/include/utils/FileMap.h index 8dfd3be..dfe6d51 100644 --- a/include/utils/FileMap.h +++ b/include/utils/FileMap.h @@ -22,6 +22,8 @@ #include <sys/types.h> +#include <utils/Compat.h> + #ifdef HAVE_WIN32_FILEMAP #include <windows.h> #endif @@ -55,7 +57,7 @@ public: * Returns "false" on failure. */ bool create(const char* origFileName, int fd, - off_t offset, size_t length, bool readOnly); + off64_t offset, size_t length, bool readOnly); /* * Return the name of the file this map came from, if known. @@ -75,7 +77,7 @@ public: /* * Get the data offset used to create this map. */ - off_t getDataOffset(void) const { return mDataOffset; } + off64_t getDataOffset(void) const { return mDataOffset; } /* * Get a "copy" of the object. @@ -118,7 +120,7 @@ private: char* mFileName; // original file name, if known void* mBasePtr; // base of mmap area; page aligned size_t mBaseLength; // length, measured from "mBasePtr" - off_t mDataOffset; // offset used when map was created + off64_t mDataOffset; // offset used when map was created void* mDataPtr; // start of requested data, offset from base size_t mDataLength; // length, measured from "mDataPtr" #ifdef HAVE_WIN32_FILEMAP |