summaryrefslogtreecommitdiffstats
path: root/include/utils
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-10-05 17:02:42 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-05 17:02:42 -0700
commit4f65ea60555ef01e6ca0cd64acc0ef698640c853 (patch)
treeb3078773f7d362251cab92b32ac8c12f25adb690 /include/utils
parent0f935ebfffee769c3c707813bf9db7d50996d785 (diff)
parentbfa33b9484e2c0a019ab81f30261b9696df23a9b (diff)
downloadframeworks_base-4f65ea60555ef01e6ca0cd64acc0ef698640c853.zip
frameworks_base-4f65ea60555ef01e6ca0cd64acc0ef698640c853.tar.gz
frameworks_base-4f65ea60555ef01e6ca0cd64acc0ef698640c853.tar.bz2
am bfa33b94: am f84a5918: Merge "Use pread() in ZipFileRO for Linux" into gingerbread
Merge commit 'bfa33b9484e2c0a019ab81f30261b9696df23a9b' * commit 'bfa33b9484e2c0a019ab81f30261b9696df23a9b': Use pread() in ZipFileRO for Linux
Diffstat (limited to 'include/utils')
-rw-r--r--include/utils/ZipFileRO.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/include/utils/ZipFileRO.h b/include/utils/ZipFileRO.h
index e1ff780..3c1f3ca 100644
--- a/include/utils/ZipFileRO.h
+++ b/include/utils/ZipFileRO.h
@@ -14,13 +14,19 @@
* limitations under the License.
*/
-//
-// Read-only access to Zip archives, with minimal heap allocation.
-//
-// This is similar to the more-complete ZipFile class, but no attempt
-// has been made to make them interchangeable. This class operates under
-// a very different set of assumptions and constraints.
-//
+/*
+ * Read-only access to Zip archives, with minimal heap allocation.
+ *
+ * This is similar to the more-complete ZipFile class, but no attempt
+ * has been made to make them interchangeable. This class operates under
+ * a very different set of assumptions and constraints.
+ *
+ * One such assumption is that if you're getting file descriptors for
+ * use with this class as a child of a fork() operation, you must be on
+ * a pread() to guarantee correct operation. This is because pread() can
+ * atomically read at a file offset without worrying about a lock around an
+ * lseek() + read() pair.
+ */
#ifndef __LIBS_ZIPFILERO_H
#define __LIBS_ZIPFILERO_H
@@ -55,6 +61,10 @@ typedef void* ZipEntryRO;
* the record structure. However, this requires a private mapping of
* every page that the Central Directory touches. Easier to tuck a copy
* of the string length into the hash table entry.
+ *
+ * NOTE: If this is used on file descriptors inherited from a fork() operation,
+ * you must be on a platform that implements pread() to guarantee correctness
+ * on the shared file descriptors.
*/
class ZipFileRO {
public: