pub fn sendfile<F1: AsFd, F2: AsFd>(
out_fd: F1,
in_fd: F2,
offset: Option<&mut off_t>,
count: usize,
) -> Result<usize>
Expand description
Copy up to count
bytes to out_fd
from in_fd
starting at offset
.
Returns a Result
with the number of bytes written.
If offset
is None
, sendfile
will begin reading at the current offset of in_fd
and will
update the offset of in_fd
. If offset
is Some
, sendfile
will begin at the specified
offset and will not update the offset of in_fd
. Instead, it will mutate offset
to point to
the byte after the last byte copied.
in_fd
must support mmap
-like operations and therefore cannot be a socket.
For more information, see the sendfile(2) man page. for Linux, see the sendfile(2) man page. for Solaris.