mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-01-19 04:13:24 +00:00
Android: Do the same file_offset_bits checks for pread64 as before. Should help #10901
This commit is contained in:
parent
b4721fbc44
commit
9e75250c4e
@ -115,7 +115,11 @@ size_t LocalFileLoader::ReadAt(s64 absolutePos, size_t bytes, size_t count, void
|
||||
#if PPSSPP_PLATFORM(ANDROID)
|
||||
// pread64 doesn't appear to actually be 64-bit safe, though such ISOs are uncommon. See #10862.
|
||||
if (absolutePos <= 0x7FFFFFFF) {
|
||||
#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS < 64
|
||||
return pread64(fd_, data, bytes * count, absolutePos) / bytes;
|
||||
#else
|
||||
return pread(fd_, data, bytes * count, absolutePos) / bytes;
|
||||
#endif
|
||||
} else {
|
||||
// Since pread64 doesn't change the file offset, it should be safe to avoid the lock in the common case.
|
||||
std::lock_guard<std::mutex> guard(readLock_);
|
||||
|
Loading…
x
Reference in New Issue
Block a user