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

Method write

core/src/mm.rs:397–407  ·  view source on GitHub ↗
(&mut self, start: usize, buf: &[u8])

Source from the content-addressed store, hash-verified

395 }
396
397 fn write(&mut self, start: usize, buf: &[u8]) -> VmResult {
398 check_access(start, buf.len())?;
399 let failed_at = access_user_memory(|| unsafe {
400 user_copy(start as _, buf.as_ptr() as *const _, buf.len())
401 });
402 if unlikely(failed_at != 0) {
403 Err(VmError::AccessDenied)
404 } else {
405 Ok(())
406 }
407 }
408}

Callers 3

cleanup_task_tablesFunction · 0.45
add_task_to_tableFunction · 0.45
load_user_appFunction · 0.45

Calls 3

check_accessFunction · 0.85
access_user_memoryFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected