path: root/include/ziparchive/zip_archive.h
diff options
authorAdam Lesinski <>2016-03-09 17:13:09 -0800
committerAdam Lesinski <>2016-03-09 17:17:19 -0800
commitb1911401e0008c2b12a3fe6c9dc34528bf7710a5 (patch)
treed8e94cf57d2740bb43f36a905e41fc792ac3b5c0 /include/ziparchive/zip_archive.h
parentdcdf300a1f5b0ad3fb517e53cfe09cc8eab05311 (diff)
libziparchive: ensure ReadAtOffset is atomic
ag/880725 modified ReadAtOffset to seek then read from the open file descriptor. Previously pread64 was used to provide atomic behaviour. This causes races when multiple threads are trying to access data from the file. This is supported, so this change reverts the relevant parts of the above CL to restore the old behaviour. Bug:27563413 Change-Id: I7bffd78da8c558745dfc3c072ba9691b1b15bb5b
Diffstat (limited to 'include/ziparchive/zip_archive.h')
1 files changed, 3 insertions, 0 deletions
diff --git a/include/ziparchive/zip_archive.h b/include/ziparchive/zip_archive.h
index 3591a6beb..7dc60aed2 100644
--- a/include/ziparchive/zip_archive.h
+++ b/include/ziparchive/zip_archive.h
@@ -152,6 +152,9 @@ void CloseArchive(ZipArchiveHandle handle);
* if this file entry contains a data descriptor footer. To verify crc32s
* and length, a call to VerifyCrcAndLengths must be made after entry data
* has been processed.
+ *
+ * On non-Windows platforms this method does not modify internal state and
+ * can be called concurrently.
int32_t FindEntry(const ZipArchiveHandle handle, const ZipString& entryName,
ZipEntry* data);