MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / gather_from_iovecs

Function gather_from_iovecs

block/src/qcow_common.rs:288–293  ·  view source on GitHub ↗

Gather bytes from iovecs starting at the given byte offset into a Vec. # Safety Caller must ensure iovecs point to valid, readable memory of sufficient size.

(iovecs: &[libc::iovec], start: usize, len: usize)

Source from the content-addressed store, hash-verified

286/// # Safety
287/// Caller must ensure iovecs point to valid, readable memory of sufficient size.
288pub unsafe fn gather_from_iovecs(iovecs: &[libc::iovec], start: usize, len: usize) -> Vec<u8> {
289 let mut result = vec![0u8; len];
290 // SAFETY: caller guarantees iovecs are valid; result has len bytes.
291 unsafe { gather_from_iovecs_into(iovecs, start, &mut result) };
292 result
293}
294
295#[cfg(test)]
296pub(crate) mod unit_tests {

Callers 1

write_vectoredMethod · 0.85

Calls 1

gather_from_iovecs_intoFunction · 0.85

Tested by

no test coverage detected