unsafe fn memcpy_fallible(dst: *mut u8, src: *const u8, len: usize) -> usize
Expand description
Copies len
bytes from src
to dst
.
This function will early stop copying if encountering an unresolvable page fault.
Returns the number of successfully copied bytes.
In the following cases, this method may cause unexpected bytes to be copied, but will not cause safety problems as long as the safety requirements are met:
- The source and destination overlap.
- The current context is not associated with valid user space (e.g., in the kernel thread).
-
src
must either be [valid] for reads oflen
bytes or be in user space forlen
bytes -
dst
must either be [valid] for writes oflen
bytes or be in user space forlen
bytes