MCPcopy Index your code
hub / github.com/RustPython/RustPython / sendfile

Function sendfile

crates/vm/src/stdlib/posix.rs:2645–2656  ·  view source on GitHub ↗
(args: SendFileArgs<'_>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

2643 #[cfg(target_os = "linux")]
2644 #[pyfunction]
2645 fn sendfile(args: SendFileArgs<'_>, vm: &VirtualMachine) -> PyResult {
2646 let mut file_offset = args.offset;
2647
2648 let res = nix::sys::sendfile::sendfile(
2649 args.out_fd,
2650 args.in_fd,
2651 Some(&mut file_offset),
2652 args.count as usize,
2653 )
2654 .map_err(|err| err.into_pyexception(vm))?;
2655 Ok(vm.ctx.new_int(res as u64).into())
2656 }
2657
2658 #[cfg(target_os = "macos")]
2659 fn _extract_vec_bytes(

Callers

nothing calls this directly

Calls 11

_extract_vec_bytesFunction · 0.85
SomeClass · 0.50
ErrClass · 0.50
into_pyexceptionMethod · 0.45
new_intMethod · 0.45
mapMethod · 0.45
as_refMethod · 0.45
sumMethod · 0.45
iterMethod · 0.45
lenMethod · 0.45
borrow_bufMethod · 0.45

Tested by

no test coverage detected