Coverage Report

Created: 2023-04-25 07:07

/rust/registry/src/index.crates.io-6f17d22bba15001f/rustix-0.37.13/src/fs/sendfile.rs
Line
Count
Source (jump to first uncovered line)
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(any(target_os = "android", target_os = "linux"))]
11
#[inline]
12
0
pub fn sendfile<OutFd: AsFd, InFd: AsFd>(
13
0
    out_fd: OutFd,
14
0
    in_fd: InFd,
15
0
    offset: Option<&mut u64>,
16
0
    count: usize,
17
0
) -> io::Result<usize> {
18
0
    backend::fs::syscalls::sendfile(out_fd.as_fd(), in_fd.as_fd(), offset, count)
19
0
}