Complete reference for all Strat9 OS syscalls. Syscalls are invoked via the syscall instruction (x86_64). Arguments are passed in registers; the return value is in RAX.
ABI convention: Success returns a non-negative value. Errors return a negative errno value (two's complement). Userspace checks if result > 0xFFFF_F000 to detect errors, then applies !result + 1 to get the errno number.
Constant Value Description
AT_FDCWD-100Use the process's current working directory as the base directory
AT_REMOVEDIR0x200Remove a directory (for SYS_UNLINKAT)
AT_SYMLINK_NOFOLLOW0x100Do not follow symbolic links (for SYS_FSTATAT)
AT_EMPTY_PATH0x1000Operate on the fd itself when path is empty
Flag Value Description
O_RDONLY0Open for reading
O_WRONLY1Open for writing
O_RDWR2Open for reading and writing
O_CREAT0x40Create file if it does not exist
O_EXCL0x800Fail if file already exists (with O_CREAT)
O_TRUNC0x200Truncate file to zero length
O_APPEND0x400Append to end of file
O_NONBLOCK0x800Non-blocking mode
O_DIRECTORY0x10000Open as directory
O_NOFOLLOW0x20000Do not follow symlinks
Flag Value Description
PROT_READ1Page can be read
PROT_WRITE2Page can be written
PROT_EXEC4Page can be executed
Constant Value Description
SIG_DFL0Default signal handling
SIG_IGN1Ignore signal
SIG_BLOCK0Block signals in set
SIG_UNBLOCK1Unblock signals in set
SIG_SETMASK2Set signal mask to set
Flag Value Description
WNOHANG1Return immediately if no child has exited
WUNTRACED2Also return for stopped children
WCONTINUED4Also return for continued children
Constant Value Description
CLOCK_REALTIME0System-wide real-time clock
CLOCK_MONOTONIC1Monotonic clock (not affected by adjustments)
CLOCK_PROCESS_CPUTIME_ID2Per-process CPU time
CLOCK_THREAD_CPUTIME_ID3Per-thread CPU time
# Syscall Parameters Return Description
0 SYS_NULL: 0 No-op (used for benchmarking)
1 SYS_HANDLE_DUPLICATEhandle: u64new handle Duplicate a capability handle
2 SYS_HANDLE_CLOSEhandle: u640 Close a capability handle
3 SYS_HANDLE_WAIThandle: u64, timeout_ns: u640 Wait on a handle (blocks until ready or timeout)
4 SYS_HANDLE_GRANThandle: u64, target_pid: u640 Grant a capability to another process
5 SYS_HANDLE_REVOKEhandle: u640 Revoke a capability (all holders lose access)
6 SYS_HANDLE_INFOhandle: u64, out_ptr: u640 Query capability info (writes HandleInfo struct)
Errors: EBADF (invalid handle), EPERM (no grant permission), ESRCH (target process not found)
# Syscall Parameters Return Description
100 SYS_MMAPaddr: u64, len: u64, prot: u64, flags: u64, fd: u64, offset: u64mapped address Map a memory region
101 SYS_MUNMAPaddr: u64, len: u640 Unmap a memory region
102 SYS_BRKaddr: u64new break Set/clear the data break
103 SYS_MREMAPold_addr: u64, old_len: u64, new_len: u64, flags: u64, new_addr: u64new address Remap a memory region
104 SYS_MPROTECTaddr: u64, len: u64, prot: u640 Change memory protection flags
105 SYS_MEM_REGION_EXPORTaddr: u64, len: u64region handle Export a memory region as a shareable handle
106 SYS_MEM_REGION_MAPregion_handle: u64, addr: u64, len: u64mapped address Map an exported memory region
107 SYS_MEM_REGION_INFOregion_handle: u64, out_ptr: u640 Query region metadata
Prot flags: PROT_READ (1), PROT_WRITE (2), PROT_EXEC (4)
Errors: EINVAL (bad alignment/flags), ENOMEM (out of memory), EACCES (permission denied), EEXIST (region already mapped)
# Syscall Parameters Return Description
200 SYS_IPC_CREATE_PORT: port handle Create a new IPC port
201 SYS_IPC_SENDport_handle: u64, msg_ptr: u64, msg_len: u640 Send a message to a port
202 SYS_IPC_RECVport_handle: u64, buf_ptr: u64, buf_len: u64bytes received Receive a message (blocks)
203 SYS_IPC_CALLport_handle: u64, msg_ptr: u64, msg_len: u64bytes received Synchronous RPC (send + wait for reply)
204 SYS_IPC_REPLYmsg_ptr: u64, msg_len: u640 Reply to the current IPC call
205 SYS_IPC_BIND_PORTport_handle: u640 Bind a port as a listener
206 SYS_IPC_UNBIND_PORTport_handle: u640 Unbind a listening port
207 SYS_IPC_TRY_RECVport_handle: u64, buf_ptr: u64, buf_len: u64bytes received (0 if empty) Non-blocking receive
208 SYS_IPC_CONNECTport_handle: u640 Connect to a bound port
210 SYS_IPC_RING_CREATEsize_log2: u64ring handle Create a shared ring buffer
211 SYS_IPC_RING_MAPring_handle: u64, addr: u640 Map a shared ring into address space
Errors: EBADF (invalid handle), ENOSPC (ring full), EAGAIN (non-blocking, nothing available), ETIMEDOUT (timeout exceeded)
# Syscall Parameters Return Description
220 SYS_CHAN_CREATEcapacity: u64channel handle Create a typed channel
221 SYS_CHAN_SENDhandle: u64, msg_ptr: u640 Send a message (blocks if full)
222 SYS_CHAN_RECVhandle: u64, msg_ptr: u640 Receive a message (blocks if empty)
223 SYS_CHAN_TRY_RECVhandle: u64, msg_ptr: u641 if received, 0 if empty Non-blocking receive
224 SYS_CHAN_CLOSEhandle: u640 Close channel handle
Errors: EBADF (invalid handle), EPIPE (all endpoints disconnected), EAGAIN (try_recv on empty channel)
# Syscall Parameters Return Description
230 SYS_SEM_CREATEinitial_value: u64semaphore handle Create a counting semaphore
231 SYS_SEM_WAIThandle: u640 Decrement (blocks if zero)
232 SYS_SEM_TRYWAIThandle: u641 if acquired, 0 if would block Non-blocking decrement
233 SYS_SEM_POSThandle: u640 Increment (wake a waiter)
234 SYS_SEM_CLOSEhandle: u640 Close semaphore handle
Errors: EBADF (invalid handle), EAGAIN (try_wait on zero semaphore)
# Syscall Parameters Return Description
240 SYS_PCI_ENUMcriteria_ptr: u64, out_ptr: u64, max_count: u64device count Enumerate PCI devices matching criteria
241 SYS_PCI_CFG_READaddr_ptr: u64, offset: u64, width: u64config value Read PCI configuration register
242 SYS_PCI_CFG_WRITEaddr_ptr: u64, offset: u64, width: u64, value: u640 Write PCI configuration register
Errors: EINVAL (invalid width/offset), EACCES (no PCI capability)
# Syscall Parameters Return Description
250 SYS_ASYNC_SETUPhandle: u64, event_mask: u64async context Set up async notification on a handle
251 SYS_ASYNC_ENTERctx: u640 Enter async wait (yields until event)
252 SYS_ASYNC_CANCELctx: u640 Cancel pending async wait
253 SYS_ASYNC_MAPctx: u64, ring_handle: u640 Map an event ring to the async context
254 SYS_ASYNC_DESTROYctx: u640 Destroy async context
# Syscall Parameters Return Description
300 SYS_PROC_EXITexit_code: u64: (never returns) Terminate current process
301 SYS_PROC_YIELD: 0 Yield CPU to scheduler
302 SYS_PROC_FORKframe: &SyscallFramechild PID (parent), 0 (child) Fork the current process (COW)
308 SYS_PROC_GETPID: process ID Get current process ID
309 SYS_PROC_GETPPID: parent PID Get parent process ID
310 SYS_PROC_WAITPIDpid: i64, status_ptr: u64, options: u64child PID Wait for a child process
311 SYS_GETPID: process ID Alias for SYS_PROC_GETPID
312 SYS_GETTID: thread ID Get current thread ID
314 SYS_PROC_WAIT: : Wait for any child
315 SYS_PROC_EXECVEpath_ptr: u64, path_len: u64, argv_ptr: u64, envp_ptr: u64: (replaces image) Execute a new program
341 SYS_THREAD_CREATEentry: u64, stack: u64, arg: u64thread ID Create a new thread
342 SYS_THREAD_JOINtid: u64, status_ptr: u640 Wait for thread to exit
343 SYS_THREAD_EXITstatus: u64: (never returns) Terminate current thread
Errors: ECHILD (no child processes), EAGAIN (thread creation failed), ENOMEM (out of memory)
# Syscall Parameters Return Description
303 SYS_FUTEX_WAITaddr: u64, val: u32, timeout_ns: u640 Sleep if *addr == val
304 SYS_FUTEX_WAKEaddr: u64, max_wake: u32woken count Wake up to N waiters
305 SYS_FUTEX_REQUEUEaddr: u64, max_wake: u32, addr2: u64, max_requeue: u32woken count Wake + requeue to addr2
306 SYS_FUTEX_CMP_REQUEUEaddr: u64, max_wake: u32, addr2: u64, max_requeue: u32, cmp_val: u32woken count Conditional requeue
307 SYS_FUTEX_WAKE_OPaddr: u64, max_wake: u32, addr2: u64, max_requeue: u32, wake_op: u32woken count Atomic op + wake
Errors: EAGAIN (value mismatch in WAIT), ETIMEDOUT (timeout expired), EFAULT (invalid address)
# Syscall Parameters Return Description
320 SYS_KILLpid: i64, signum: u320 Send signal to a process
321 SYS_SIGPROCMASKhow: i32, set_ptr: u64, oldset_ptr: u640 Get/set signal mask
322 SYS_SIGACTIONsignum: u64, act_ptr: u64, oact_ptr: u640 Set signal handler
323 SYS_SIGALTSTACKss_ptr: u64, old_ss_ptr: u640 Set alternate signal stack
324 SYS_SIGPENDINGset_ptr: u640 Get pending signals
325 SYS_SIGSUSPENDmask_ptr: u64: (restarted on signal) Suspend until signal
326 SYS_SIGTIMEDWAITset_ptr: u64, info_ptr: u64, timeout_ptr: u64signal number Wait for specific signal
327 SYS_SIGQUEUEpid: i64, signum: u32, sigval_ptr: u640 Queue a signal with data
328 SYS_KILLPGpgrp: u64, signum: u320 Send signal to process group
352 SYS_TGKILLtgid: u64, tid: u64, signum: u320 Send signal to specific thread
353 SYS_RT_SIGRETURN: : Return from signal handler
# Syscall Parameters Return Description
316 SYS_FCNTLfd: u64, cmd: u64, arg: u64depends on cmd File control operations
317 SYS_SETPGIDpid: u64, pgid: u640 Set process group ID
318 SYS_GETPGIDpid: u64pgid Get process group ID
319 SYS_SETSID: session ID Create new session
329 SYS_GETITIMERwhich: u64, out_ptr: u640 Get interval timer
330 SYS_SETITIMERwhich: u64, in_ptr: u64, out_ptr: u640 Set interval timer
331 SYS_GETPGRP: pgrp Get current process group
332 SYS_GETSIDpid: u64sid Get session ID
333 SYS_SET_TID_ADDRESStidptr: u640 Set clear-on-exit TID address
334 SYS_EXIT_GROUPexit_code: u64: (never returns) Exit all threads in process
# Syscall Parameters Return Description
335 SYS_GETUID: uid Get real user ID
336 SYS_GETEUID: euid Get effective user ID
337 SYS_GETGID: gid Get real group ID
338 SYS_GETEGID: egid Get effective group ID
339 SYS_SETUIDuid: u640 Set user ID
340 SYS_SETGIDgid: u640 Set group ID
# Syscall Parameters Return Description
344 SYS_UNAMEuts_ptr: u640 Get system information (name, release, etc.)
350 SYS_ARCH_PRCTLcode: u64, addr: u640 Architecture-specific process control
# Syscall Parameters Return Description
403 SYS_OPENpath_ptr: u64, path_len: u64, flags: u64file descriptor Open a file
404 SYS_WRITEfd: u64, buf_ptr: u64, buf_len: u64bytes written Write to a file descriptor
405 SYS_READfd: u64, buf_ptr: u64, buf_len: u64bytes read Read from a file descriptor
406 SYS_CLOSEfd: u640 Close a file descriptor
407 SYS_LSEEKfd: u64, offset: u64, whence: u64new position Seek in a file
408 SYS_FSTATfd: u64, stat_ptr: u640 Get file status (fstat)
409 SYS_STATpath_ptr: u64, path_len: u64, stat_ptr: u640 Get file status by path
413 SYS_ACCESSpath_ptr: u64, path_len: u64, mode: u640 Check file accessibility (uses effective UID/GID, not real). Prefer SYS_FACCESSAT for new code.
430 SYS_GETDENTSfd: u64, buf_ptr: u64, buf_len: u64bytes read Read directory entries
431 SYS_PIPEfds_ptr: u640 Create a pipe pair
432 SYS_DUPold_fd: u64new fd Duplicate file descriptor
433 SYS_DUP2old_fd: u64, new_fd: u64new fd Duplicate to specific fd
456 SYS_PREADfd: u64, buf_ptr: u64, buf_len: u64, offset: u64bytes read Pread at offset
457 SYS_PWRITEfd: u64, buf_ptr: u64, buf_len: u64, offset: u64bytes written Pwrite at offset
Open flags: O_RDONLY (0), O_WRONLY (1), O_RDWR (2), O_CREAT (0x40), O_TRUNC (0x200), O_APPEND (0x400), O_EXCL (0x800)
Errors: ENOENT (file not found), EACCES (permission denied), EBADF (bad fd), ENOTDIR (not a directory), EISDIR (is a directory), ENOSPC (disk full), EIO (I/O error)
# Syscall Parameters Return Description
440 SYS_CHDIRpath_ptr: u64, path_len: u640 Change working directory
441 SYS_FCHDIRfd: u640 Change working directory by fd
442 SYS_GETCWDbuf_ptr: u64, buf_len: u64bytes written Get current working directory
443 SYS_IOCTLfd: u64, cmd: u64, arg: u64depends on cmd Device I/O control
444 SYS_UMASKmask: u64old mask Set file mode creation mask
445 SYS_UNLINKpath_ptr: u64, path_len: u640 Delete a file
446 SYS_RMDIRpath_ptr: u64, path_len: u640 Remove a directory
447 SYS_MKDIRpath_ptr: u64, path_len: u64, mode: u640 Create a directory
448 SYS_RENAMEold_ptr: u64, old_len: u64, new_ptr: u64, new_len: u640 Rename a file
449 SYS_LINKold_ptr: u64, old_len: u64, new_ptr: u64, new_len: u640 Create a hard link
450 SYS_SYMLINKtarget_ptr: u64, target_len: u64, link_ptr: u64, link_len: u640 Create a symbolic link
451 SYS_READLINKpath_ptr: u64, path_len: u64, buf_ptr: u64, buf_len: u64bytes read Read symbolic link target
452 SYS_CHMODpath_ptr: u64, path_len: u64, mode: u640 Change file permissions
453 SYS_FCHMODfd: u64, mode: u640 Change file permissions by fd
454 SYS_TRUNCATEpath_ptr: u64, path_len: u64, len: u640 Truncate a file
455 SYS_FTRUNCATEfd: u64, len: u640 Truncate a file by fd
These syscalls resolve paths relative to a directory file descriptor instead of the process CWD. They are the POSIX-standard way to open, stat, and manipulate files safely in multi-threaded programs.
Value Constant Meaning
-100AT_FDCWDUse the process's current working directory (CWD) as the base
≥ 0valid fd Use the opened directory referenced by this file descriptor
# Syscall Parameters Return Description
462 SYS_OPENATdirfd: u64, path_ptr: u64, path_len: u64, flags: u64file descriptor Open a file relative to dirfd. If path_ptr is absolute, dirfd is ignored.
463 SYS_FSTATATdirfd: u64, path_ptr: u64, path_len: u64, stat_ptr: u64, flags: u640 Get file status relative to dirfd. stat_ptr receives a FileStat struct.
464 SYS_UNLINKATdirfd: u64, path_ptr: u64, path_len: u64, flags: u640 Delete a file relative to dirfd. If AT_REMOVEDIR flag is set, removes a directory.
465 SYS_RENAMEATolddirfd: u64, old_ptr: u64, old_len: u64, newdirfd: u64, new_ptr: u64, new_len: u640 Rename/move a file. Source and destination can have different base directories.
466 SYS_MKDIRATdirfd: u64, path_ptr: u64, path_len: u64, mode: u640 Create a directory relative to dirfd.
467 SYS_READLINKATdirfd: u64, path_ptr: u64, path_len: u64, buf_ptr: u64, buf_len: u64bytes read Read the target of a symbolic link relative to dirfd.
468 SYS_FACCESSATdirfd: u64, path_ptr: u64, path_len: u64, mode: u64, flags: u640 Check file accessibility. mode: R_OK (4), W_OK (2), X_OK (1), F_OK (0).
Flag Value Description
AT_FDCWD-100Use process CWD as base directory
AT_REMOVEDIR0x200Unlink a directory instead of a file (for SYS_UNLINKAT)
AT_SYMLINK_NOFOLLOW0x100Do not follow symlinks (for SYS_FSTATAT)
AT_EMPTY_PATH0x1000Operate on dirfd itself when path is empty
EBADF (invalid dirfd), ENOENT (path not found), EACCES (permission denied), ENOTDIR (dirfd is not a directory), EEXIST (file exists for CREATE_EXCL), EINVAL (invalid flags)
# Syscall Parameters Return Description
460 SYS_POLLfds_ptr: u64, nfds: u64, timeout_ms: i64ready count Poll file descriptors
461 SYS_PPOLLfds_ptr: u64, nfds: u64, timeout_ptr: u64, sigmask_ptr: u64ready count Ppoll with signal mask
# Syscall Parameters Return Description
410 SYS_NET_RECVbuf_ptr: u64, buf_len: u64bytes received Receive network packet
411 SYS_NET_SENDbuf_ptr: u64, buf_len: u64bytes sent Send network packet
412 SYS_NET_INFOinfo_type: u64, buf_ptr: u640 Query network info (IP, gateway, etc.)
# Syscall Parameters Return Description
420 SYS_VOLUME_READhandle: u64, offset: u64, buf_ptr: u64, buf_len: u64bytes read Read from volume
421 SYS_VOLUME_WRITEhandle: u64, offset: u64, buf_ptr: u64, buf_len: u64bytes written Write to volume
422 SYS_VOLUME_INFOhandle: u64, out_ptr: u640 Query volume info
# Syscall Parameters Return Description
500 SYS_CLOCK_GETTIMEclock_id: u64, tp_ptr: u640 Get clock time
501 SYS_NANOSLEEPreq_ptr: u64, rem_ptr: u640 Sleep for a duration
502 SYS_CLOCK_NANOSLEEPclock_id: u64, flags: u64, req_ptr: u64, rem_ptr: u640 Sleep on a specific clock
Clock IDs: CLOCK_REALTIME (0), CLOCK_MONOTONIC (1), CLOCK_PROCESS_CPUTIME_ID (2), CLOCK_THREAD_CPUTIME_ID (3)
# Syscall Parameters Return Description
600 SYS_DEBUG_LOGmsg_ptr: u64, msg_len: u640 Write a debug message to kernel log
601 SYS_GETRANDOMbuf: u64, len: usize, flags: u32bytes written Fill buffer with random bytes
610 SYS_SET_ROBUST_LISThead: u64, len: usize0 Set robust futex list head
611 SYS_GET_ROBUST_LISTpid: i64, head_ptr: u64, len_ptr: u640 Get robust futex list head
# Syscall Parameters Return Description
700 SYS_MODULE_LOADpath_ptr: u64, path_len: u64module ID Load a kernel module
701 SYS_MODULE_UNLOADmodule_id: u640 Unload a kernel module
702 SYS_MODULE_GET_SYMBOLmodule_id: u64, name_ptr: u64, name_len: u64symbol address Look up a symbol in a loaded module
703 SYS_MODULE_QUERYout_ptr: u64, max_count: u64module count List loaded modules
# Syscall Parameters Return Description
800 SYS_SILO_CREATE: silo ID Create a new silo
801 SYS_SILO_CONFIGsilo_id: u64, key_ptr: u64, key_len: u64, val_ptr: u64, val_len: u640 Configure a silo
802 SYS_SILO_ATTACH_MODULEsilo_id: u64, module_id: u640 Attach a module to a silo
803 SYS_SILO_STARTsilo_id: u640 Start a silo
804 SYS_SILO_STOPsilo_id: u640 Stop a silo
805 SYS_SILO_KILLsilo_id: u640 Kill a silo (force stop)
806 SYS_SILO_EVENT_NEXTsilo_id: u64, out_ptr: u640 Wait for next silo event
807 SYS_SILO_SUSPENDsilo_id: u640 Suspend a silo
808 SYS_SILO_RESUMEsilo_id: u640 Resume a silo
809 SYS_SILO_PLEDGEpromises_ptr: u64, promises_len: u640 Restrict syscalls (pledge)
810 SYS_SILO_UNVEILpath_ptr: u64, path_len: u64, perms_ptr: u64, perms_len: u640 Restrict filesystem access (unveil)
811 SYS_SILO_ENTER_SANDBOX: 0 Enter sandbox mode (irreversible)
812 SYS_SILO_RENAMEsilo_id: u64, name_ptr: u64, name_len: u640 Rename a silo
# Syscall Parameters Return Description
900 SYS_ABI_VERSION: (major << 16) | minorQuery ABI version
Value Name Description
1 EPERMOperation not permitted
2 ENOENTNo such file or directory
3 ESRCHNo such process
4 EINTRInterrupted system call
5 EIOInput/output error
7 E2BIGArgument list too long
9 EBADFBad file descriptor
10 ECHILDNo child processes
11 EAGAINResource temporarily unavailable
12 ENOMEMOut of memory
13 EACCESPermission denied
14 EFAULTBad address
17 EEXISTFile exists
20 ENOTDIRNot a directory
21 EISDIRIs a directory
22 EINVALInvalid argument
28 ENOSPCNo space left on device
32 EPIPEBroken pipe
38 ENOSYSFunction not implemented
52 ENOTSUPNot supported
98 EADDRINUSEAddress already in use
110 ETIMEDOUTConnection timed out
111 ECONNREFUSEDConnection refused