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

Method read

api/src/syscall/fs/io.rs:239–249  ·  view source on GitHub ↗
(&mut self, mut buf: &mut [u8])

Source from the content-addressed store, hash-verified

237 }
238
239 fn read(&mut self, mut buf: &mut [u8]) -> AxResult<usize> {
240 match self {
241 SendFile::Direct(file) => file.read(&mut buf),
242 SendFile::Offset(file, offset) => {
243 let off = offset.vm_read()?;
244 let bytes_read = file.inner().read_at(&mut buf, off)?;
245 offset.vm_write(off + bytes_read as u64)?;
246 Ok(bytes_read)
247 }
248 }
249 }
250
251 fn write(&mut self, mut buf: &[u8]) -> AxResult<usize> {
252 match self {

Callers 11

sys_prlimit64Function · 0.45
sys_cloneFunction · 0.45
do_selectFunction · 0.45
sys_pidfd_getfdFunction · 0.45
flags_to_optionsFunction · 0.45
sys_close_rangeFunction · 0.45
sys_fcntlFunction · 0.45
sys_readFunction · 0.45
sys_readvFunction · 0.45
do_sendFunction · 0.45
sys_memfd_createFunction · 0.45

Calls 2

read_atMethod · 0.45
innerMethod · 0.45

Tested by

no test coverage detected