MCPcopy Create free account
hub / github.com/Starry-OS/StarryOS / read

Method read

core/src/mm.rs:385–395  ·  view source on GitHub ↗
(&mut self, start: usize, buf: &mut [MaybeUninit<u8>])

Source from the content-addressed store, hash-verified

383 }
384
385 fn read(&mut self, start: usize, buf: &mut [MaybeUninit<u8>]) -> VmResult {
386 check_access(start, buf.len())?;
387 let failed_at = access_user_memory(|| unsafe {
388 user_copy(buf.as_mut_ptr() as *mut _, start as _, buf.len())
389 });
390 if unlikely(failed_at != 0) {
391 Err(VmError::AccessDenied)
392 } else {
393 Ok(())
394 }
395 }
396
397 fn write(&mut self, start: usize, buf: &[u8]) -> VmResult {
398 check_access(start, buf.len())?;

Callers 7

on_enterMethod · 0.45
tasksFunction · 0.45
get_taskFunction · 0.45
processesFunction · 0.45
get_process_dataFunction · 0.45
get_process_groupFunction · 0.45
get_sessionFunction · 0.45

Calls 3

check_accessFunction · 0.85
access_user_memoryFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected