| 13 | namespace butil { |
| 14 | |
| 15 | bool EvictFileFromSystemCache(const FilePath& file) { |
| 16 | ScopedFD fd(open(file.value().c_str(), O_RDONLY)); |
| 17 | if (!fd.is_valid()) |
| 18 | return false; |
| 19 | if (fdatasync(fd.get()) != 0) |
| 20 | return false; |
| 21 | if (posix_fadvise(fd.get(), 0, 0, POSIX_FADV_DONTNEED) != 0) |
| 22 | return false; |
| 23 | return true; |
| 24 | } |
| 25 | |
| 26 | } // namespace butil |