Skip to main content

Module ipc

Module ipc 

Source
Expand description

IPC syscall wrappers - §8.2.

Typed wrappers so service code cannot accidentally call the wrong syscall number or pass a malformed message size.

Structs§

Message
An IPC message as seen by service code.

Enums§

IpcError

Constants§

MAX_PAYLOAD

Functions§

call
Synchronous CALL (syscall 41): send request to target carrying reply_grant as a one-shot reply cap, then block on recv (the caller’s own endpoint, where the reply lands) until the peer replies OR the peer’s endpoint dies. Returns the reply, Err(ReplyDead) if the peer died before replying, Err(EndpointDead) if the peer was already dead when the request was sent, or another IpcError on a failed send.
call_deadline_into
call, bounded, receiving into a caller-owned buffer.
recv
Block until a message is available on endpoint. (§8.2 - recv)
recv_timeout
Blocking recv with a timeout in counter ticks (the kernel waits at least one scheduler tick): Ok(Some(msg)) on a message, Ok(None) on timeout, Err on a real error. timeout_cycles == 0 blocks forever (like recv). (syscall 35 - recv_timeout) Lets a driver idle on its interrupt yet still wake on a timer (e.g. for keyboard auto-repeat while a key is held - §12).
recv_timeout_into
Receive into a buffer the CALLER owns, returning the byte count.
send
Send a message to endpoint; block if the queue is full. (§8.2 - send)
try_recv
Non-blocking recv: return Ok(None) immediately if the endpoint queue is empty, Ok(Some(msg)) if a message was waiting. (syscall 34 - try_recv) Lets a busy-polling driver drain interrupt events (§12) without giving up its loop.
try_send
Send without blocking; return QueueFull immediately. (§8.2 - try_send)