Source code

Revision control

Copy as Markdown

Other Tools

use crate::{backend, io};
use backend::fd::AsFd;
use backend::fs::types::Advice;
/// `posix_fadvise(fd, offset, len, advice)`—Declares an expected access
/// pattern for a file.
///
/// # References
/// - [POSIX]
/// - [Linux]
///
#[inline]
#[doc(alias = "posix_fadvise")]
pub fn fadvise<Fd: AsFd>(fd: Fd, offset: u64, len: u64, advice: Advice) -> io::Result<()> {
backend::fs::syscalls::fadvise(fd.as_fd(), offset, len, advice)
}