In %rax, the syscall id is specified.
If the operation succeeds, %rax contains the result (think SystemV ABI) (≥ 0). If it fails, %rax contains the opposite of the error code. (< 0)
-Error codes:
- 0: ERR_NONE: no error
- 0: ERR_USER: server-defined error
-
sport_t make_sport();
Creates a server port, with no associated clients.
cport_t make_cport(sport_t);
Takes a client port, and returns a new client port that points to the same server port.
bool has_cports(sport_t);
- Takes a server port, and returns the number of clients linked to it.
+ Takes a server port, and returns whether or not it has any client ports.
void close(port_t);
Close a port. It no longer exists in this process.
If it was a server port, any use of any of its client ports for the purpose
Returns the server port in question.
{int64_t out_s, uint64_t user_error_code} call(cport_t p, int64_t in_s, const void* in, cport_t* io_p, int64_t out_s, void* out);
- Blocks until the server refered to by p replies, or reports an error.
+ Blocks until the server refered to by p replies. //, or reports an error.
handler receive(sport_t p);
Block until any client sends a message to the port p.
int64_t receive_size(handler client);
Invalidates caller.
Replies to the caller with the data of length in_s in `in`.
If in_p is non-0, a copy of it is sent as well.
-void forward(cport_t to, handler caller, int64_t sub_begin, int64_t sub_len);
- Invalidates caller.
- Transfers message to `to` (reply will go to the original client still).
- 0 ≤ sub_begin ≤ receive_size(client) and 0 ≤ sub_len ≤ receive_size(client) - sub_begin.
- The data transferred will only be that in data[sub_begin; sub_begin + sub_len[, ∅ if sub_len == 0.
-void error(handler caller, uint64_t error_code);
- Invalidates caller.
- Call gets ERR_USER, with the second value set to error_code.
+// void forward(cport_t to, handler caller, int64_t sub_begin, int64_t sub_len);
+ // Invalidates caller.
+ // Transfers message to `to` (reply will go to the original client still).
+ // 0 ≤ sub_begin ≤ receive_size(client) and 0 ≤ sub_len ≤ receive_size(client) - sub_begin.
+ // The data transferred will only be that in data[sub_begin; sub_begin + sub_len[, ∅ if sub_len == 0.
+// void error(handler caller, uint64_t error_code);
+ // Invalidates caller.
+ // Call gets ERR_USER, with the second value set to error_code.