MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / receive

Function receive

euralios_std/src/syscalls.rs:237–256  ·  view source on GitHub ↗

Wait for a message to be received

(handle: &CommHandle)

Source from the content-addressed store, hash-verified

235
236/// Wait for a message to be received
237pub fn receive(handle: &CommHandle) -> Result<Message, SyscallError> {
238 let ctrl: u64;
239 let (data1, data2, data3): (u64, u64, u64);
240 unsafe {
241 asm!("syscall",
242 in("rax") SYSCALL_RECEIVE,
243 in("rdi") handle.0,
244 lateout("rax") ctrl,
245 lateout("rdi") data1,
246 lateout("rsi") data2,
247 lateout("rdx") data3,
248 out("rcx") _,
249 out("r11") _);
250 }
251 let err = ctrl & 0xFF;
252 if err == 0 {
253 return Ok(Message::from_values(ctrl, data1, data2, data3));
254 }
255 Err(SyscallError(err))
256}
257
258/// Send a message and wait for it to be received
259///

Callers 13

mainFunction · 0.85
exec_pathFunction · 0.85
display_textFunction · 0.85
mainFunction · 0.85
exec_pathFunction · 0.85
dispatch_loopFunction · 0.85
read_lineMethod · 0.85
mainFunction · 0.85
writer_handlerFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
open_socketFunction · 0.85

Calls 1

SyscallErrorClass · 0.85

Tested by

no test coverage detected