/rust/registry/src/index.crates.io-1949cf8c6b5b557f/rustix-1.1.2/src/fs/sendfile.rs
Line | Count | Source |
1 | | use crate::{backend, io}; |
2 | | use backend::fd::AsFd; |
3 | | |
4 | | /// `sendfile(out_fd, in_fd, offset, count)`—Transfer data between file |
5 | | /// descriptors. |
6 | | /// |
7 | | /// # References |
8 | | /// - [Linux] |
9 | | /// |
10 | | /// [Linux]: https://man7.org/linux/man-pages/man2/sendfile.2.html |
11 | | #[cfg(linux_kernel)] |
12 | | #[inline] |
13 | 0 | pub fn sendfile<OutFd: AsFd, InFd: AsFd>( |
14 | 0 | out_fd: OutFd, |
15 | 0 | in_fd: InFd, |
16 | 0 | offset: Option<&mut u64>, |
17 | 0 | count: usize, |
18 | 0 | ) -> io::Result<usize> { |
19 | 0 | backend::fs::syscalls::sendfile(out_fd.as_fd(), in_fd.as_fd(), offset, count) |
20 | 0 | } |