(&mut self, size: u64)
| 243 | |
| 244 | #[cfg(all(feature = "fallocate", target_os = "linux"))] |
| 245 | fn fallocate(&mut self, size: u64) -> io::Result<()> { |
| 246 | use nix::fcntl::{fallocate, FallocateFlags}; |
| 247 | |
| 248 | fallocate(self, FallocateFlags::FALLOC_FL_KEEP_SIZE, 0, size as _)?; |
| 249 | Ok(()) |
| 250 | } |
| 251 | |
| 252 | // Fail compilation if `fallocate` is enabled but not supported. |
| 253 | #[cfg(all(feature = "fallocate", not(target_os = "linux"), not(any(test, feature = "test"))))] |