| 816 | } |
| 817 | |
| 818 | bool TFileHandle::FlushCache(i64 offset, i64 length, bool wait) noexcept { |
| 819 | #if HAVE_SYNC_FILE_RANGE |
| 820 | int flags = SYNC_FILE_RANGE_WRITE; |
| 821 | if (wait) { |
| 822 | flags |= SYNC_FILE_RANGE_WAIT_AFTER; |
| 823 | } |
| 824 | int ret = ::sync_file_range(Fd_, offset, length, flags); |
| 825 | return ret == 0 || errno == EROFS; |
| 826 | #else |
| 827 | Y_UNUSED(offset); |
| 828 | Y_UNUSED(length); |
| 829 | if (wait) { |
| 830 | return FlushData(); |
| 831 | } |
| 832 | return true; |
| 833 | #endif |
| 834 | } |
| 835 | |
| 836 | TString DecodeOpenMode(ui32 mode0) { |
| 837 | ui32 mode = mode0; |