1 use crate::{backend, io};
2 use backend::fd::AsFd;
3
4 /// `sendfile(out_fd, in_fd, offset, count)`
5 ///
6 /// # References
7 /// - [Linux]
8 ///
9 /// [Linux]: https://man7.org/linux/man-pages/man2/sendfile.2.html
10 #[cfg(linux_kernel)]
11 #[inline]
sendfile<OutFd: AsFd, InFd: AsFd>( out_fd: OutFd, in_fd: InFd, offset: Option<&mut u64>, count: usize, ) -> io::Result<usize>12 pub fn sendfile<OutFd: AsFd, InFd: AsFd>(
13 out_fd: OutFd,
14 in_fd: InFd,
15 offset: Option<&mut u64>,
16 count: usize,
17 ) -> io::Result<usize> {
18 backend::fs::syscalls::sendfile(out_fd.as_fd(), in_fd.as_fd(), offset, count)
19 }
20