Error Codes
Every syscall and capability invocation in SaltyOS returns a TronaResult:
#[repr(C)]
pub struct TronaResult {
pub error: u64, // 0 = TRONA_OK, non-zero = error code
pub value: u64, // result on success; undefined on error
}
The error field carries one of the TRONA_* constants documented on this page.
TRONA_OK = 0 is universal; any other value is an error, and the value field is not meaningful.
This page lists every error code defined in lib/trona/uapi/consts/kernel.rs (kernel-base errors) and lib/trona/uapi/consts/server.rs (extended errors used by servers and the network stack).
The POSIX errno values that basalt’s C ABI layer maps these to are covered by basalt: The trona boundary.
Kernel base errors (consts/kernel.rs)
These codes are raised by kernite itself and by core substrate primitives.
The low range (0–15) is dense; a sparse "second band" starts at 0x10 for file-system and memory-mapping errors and ends at 0x80 for the asynchronous-pending placeholder.
Low range — general-purpose errors
| Code | Constant | Meaning |
|---|---|---|
|
|
Success. |
|
|
The target capability slot is empty, out-of-range, or the wrong type for this operation. |
|
|
The invoke label or IPC protocol label does not correspond to a valid operation for this object. |
|
|
The capability does not carry the rights bits required for this operation. |
|
|
One of the scalar arguments is outside the acceptable range or has an invalid encoding. |
|
|
A kernel or server allocation failed (frame alloc, slab, or CNode slot). |
|
|
The requested object (name, PID, fd, slot, …) does not exist. |
|
|
The target is in use and cannot be torn down or reconfigured right now. |
|
|
The requested name or slot is already occupied. |
|
|
A non-blocking operation would have to wait for a resource. Returned by |
|
|
A pointer argument is NULL, misaligned, or outside the caller’s address space. |
|
|
Numeric offset, size, or count exceeds the allowed range. |
|
|
The operation was cancelled — typically by |
|
|
The syscall was interrupted and should be retried. This is the code |
|
|
A recursive lock or forbidden self-lock was detected. |
|
|
The operation was interrupted by a signal delivered to the current thread. |
Second band — filesystem, mapping, and state errors
| Code | Constant | Meaning |
|---|---|---|
|
|
A long-running operation has started but is not yet complete. |
|
|
The argument exceeds a size limit (path, filename, map size, …). |
|
|
The requested feature is valid but not implemented in this build. |
|
|
The target cannot be modified — read-only mount, read-only cap, or read-only page mapping. |
|
|
Path walk encountered a non-directory where a directory was expected. |
|
|
The target is a directory but a non-directory operation was requested. |
|
|
Symbolic link resolution exceeded the internal depth limit. |
|
|
The underlying device or backing store returned an I/O error. |
|
|
A |
|
|
A |
|
|
The notification or endpoint is already bound to a TCB. |
|
|
A server has accepted the request and will deliver the result asynchronously. Not a failure — this is the sentinel that the split-blocking primitives ( |
TRONA_IN_PROGRESS (0x10) and TRONA_TOO_LARGE (0x11) happen to fall in the same numeric range as TRONA_BAD_ADDRESS (10) and TRONA_OUT_OF_RANGE (11) when printed in decimal vs hex.
Always compare against the TRONA_* constants, not against raw numbers.
|
Extended network errors (consts/server.rs)
These codes are used by netsrv, dnssrv, and any server that needs to report a network-specific failure.
They live in the 21–32 range.
| Code | Constant | Meaning |
|---|---|---|
|
|
|
|
|
|
|
|
DNS NXDOMAIN — the name does not exist. |
|
|
DNS SERVFAIL — the upstream DNS server failed to process the query. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mapping to POSIX errno
basalt’s C ABI wrappers convert TRONA_* errors to POSIX errno values in the per-thread errno slot before returning -1 (or the POSIX-typed error).
The mapping is not mechanical: several TRONA_* codes collapse into a single errno value, and several errno values are raised only in trona_posix (not in substrate).
| TRONA code | POSIX errno (as mapped by basaltc) |
|---|---|
|
(no errno) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(resolved by |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(not an error — not mapped; clients wait for a completion notification) |
|
|
The authoritative map is in basalt’s compat/freebsd/errno.rs and the basaltc-side wrappers that invoke trona_posix.
This table is a convenience reference; whenever it disagrees with the code, the code wins.
Design principle — one code per failure mode, not per function
The trona error space is narrow by design. Rather than defining a unique error for every possible failure, trona collapses every failure into one of the ~40 codes above and documents per-operation semantics in the operation’s own spec. The rationale is:
-
A narrow error space keeps the kernel’s dispatch logic small.
-
Servers can forward errors through multiple layers without losing the original meaning.
-
Clients can make broad decisions (retryable? permission? not found?) without having to special-case every protocol label.
When a server needs to report a failure that does not fit any existing code, the right move is usually to reuse the closest existing code and add a per-protocol subfield (e.g. a pre-defined errno returned in value), not to add a new global TRONA_* code.
New global codes should only be added for failure modes that cross protocol boundaries — TRONA_DNS_NXDOMAIN is a good example because it is also handled by VFS when resolving mount paths.
Related pages
-
Syscall ABI — the
TronaResultreturn contract every syscall uses. -
Invoke Labels — capability invocations that return these codes.
-
IPC Protocol Labels — server protocols that return these codes.
-
basalt: The trona boundary — how C code converts these codes into POSIX
errno.