Avoid fadvise on older Android. Fixes #84

PiperOrigin-RevId: 613815953
This commit is contained in:
Jan Wassenberg 2024-03-07 22:18:46 -08:00 committed by Copybara-Service
parent 3cdd5e524a
commit fce5c8c967
1 changed files with 1 additions and 1 deletions

View File

@ -341,7 +341,7 @@ BlobError BlobReader::Open(const char* filename) {
#endif
if (fd_ < 0) return __LINE__;
#if HWY_OS_LINUX
#if HWY_OS_LINUX && (!defined(__ANDROID_API__) || __ANDROID_API__ >= 21)
// Doubles the readahead window, which seems slightly faster when cached.
(void)posix_fadvise(fd_, 0, 0, POSIX_FADV_SEQUENTIAL);
#endif