Skip to content

CallTimeout

Sends a message to a port and blocks until the server replies, or until a timeout.

Number Selector Blocking Since
0x05 SVC_CALL — yes 2.0
SvcResult CallTimeout(Handle port, uint32_t xlen, Handle grant_handle, Duration timeout);

Registers: (port, xlen, grant, timeout) -> r0 status, r1 reply length, r3 granted handle

The request is the first xlen bytes of the caller's message box; the reply arrives in the same place. Callers queue by priority, and the server runs at the caller's priority while serving (priority inheritance).

The timeout covers the whole call: waiting to be received and waiting for the reply. When it expires the call is withdrawn. A server that already took it finds its reply capability gone: a late Reply() returns ERR_BADHANDLE, and a late ReplyRecv() just waits for the next call, so the stale answer cannot be mistaken for the reply to a later call.

Parameters

Name Direction Description
port in Port handle with PERM_SEND.
xlen in Request length in bytes, at most MSG_BUF_SIZE.
grant_handle in Handle (with PERM_TXFR) to copy to the server, or -1.
timeout in Milliseconds to wait for the reply, or TIMEOUT_INFINITE. TIMEOUT_POLL always returns ERR_TIMEOUT, since a call cannot finish without blocking.

Returns

r0 is the status; r1 the reply length; r3 a handle granted back, or -1.

Errors

Error Condition
ERR_TIMEOUT No reply within timeout.
ERR_OVERFLOW xlen is larger than MSG_BUF_SIZE.
ERR_BADHANDLE port or grant_handle is not a live handle.
ERR_BADTYPE port is not a port.
ERR_NOPERM port lacks PERM_SEND, or grant_handle lacks PERM_TXFR.
ERR_DEAD The port died, or the server died before replying.
ERR_NOMEM The server's handle table is full (when granting).