Illumos Package
Direct Illumos x86-64 system-call bindings for Rux programs.
Module: Illumos
The package provides raw zero-to-six-argument syscall entry points, typed wrappers for common I/O, process, memory, and time operations, and the constants and structures those wrappers require. It calls the kernel without libc.
Unstable API
The Illumos package is under active development and its API is not yet stable. Pin a package version when reproducible builds are required.
Requirements
- An Illumos distribution on x86-64, such as OmniOS, OpenIndiana, or SmartOS
- A Rux compiler with the
rux-illumossyscall thunks
The syscall numbers and calling convention are platform- and architecture-specific. Prefer Std when it provides the operation you need.
Installation
Add the package and install project dependencies:
rux add Illumos
rux installThen import the symbols you need:
import Illumos::{ Stdout, Write };Result Convention
Functions returning int64 expose the thunk result directly. The package treats values from 1 through 4095 as positive errno values; IsError performs exactly that range check and Errno returns the value when it falls in that range.
Ambiguous positive results
The current convention overlaps legitimate small positive success values, including byte counts returned by Read and Write, and potentially process IDs. Consequently, IsError can misclassify a successful result. Interpret each function's result according to its own contract; do not apply IsError blindly to every positive result.
The package does not set a thread-local errno, retry interrupted calls, or convert failures into exceptions.
Reference
| Topic | Contents |
|---|---|
Types and constants | File descriptors, flags, clocks, and Timespec. |
I/O | Read, write, and close file descriptors. |
Memory | Map, unmap, and change the program break. |
Process | Process ID and immediate termination. |
Time | Read clocks and suspend execution. |
Raw syscalls | Syscall0-Syscall6 and error helpers. |
Example
import Illumos::{ Stdout, Write };
func Main() -> int32 {
let message = "hello from Illumos\n";
let result = Write(Stdout, message.data, message.length);
// A complete write returns the requested byte count.
return result == message.length as int64 ? 0i32 : 1i32;
}