Expand description
Strat9 OS error codes (errno values).
ABI convention: syscalls return usize in RAX.
- Success: any non-negative value.
- Error: negative errno in two’s complement.
Userspace detects errors with if result > 0xFFFF_F000, then converts:
ⓘ
let errno = !result + 1; // or equivalently: -(result as isize) as usizeConstants§
- E2BIG
- Argument list too long (execve path or argv exceeds limit).
- EACCES
- Permission denied (capability check failed, file mode mismatch).
- EADDRINUSE
- Address already in use (socket bind to occupied port/address).
- EAFNOSUPPORT
- Address family not supported (socket type not available).
- EAGAIN
- Resource temporarily unavailable (non-blocking would block).
- EBADF
- Bad file descriptor (fd not open or already closed).
- ECHILD
- No child processes (waitpid on non-existent child).
- ECONNREFUSED
- Connection refused (no listener on target port).
- EEXIST
- File exists (O_CREAT | O_EXCL on existing file).
- EFAULT
- Bad address (invalid pointer in syscall argument).
- EINTR
- Interrupted system call (signal delivered during blocking op).
- EINVAL
- Invalid argument (bad alignment, invalid flags, etc.).
- EIO
- Input/output error (hardware failure, bad sector, etc.).
- EISDIR
- Is a directory (expected file, got directory).
- ELOOP
- Too many levels of symbolic links (symlink loop detected).
- ENAMETOOLONG
- File name too long (path exceeds PATH_MAX).
- ENOBUFS
- No buffer space available (network buffer exhaustion).
- ENOENT
- No such file or directory.
- ENOEXEC
- Exec format error (invalid ELF binary, wrong architecture).
- ENOMEM
- Cannot allocate memory (kernel heap or page allocation failed).
- ENOSPC
- No space left on device (disk full, inode exhaustion).
- ENOSYS
- Function not implemented (syscall not supported by kernel).
- ENOTDIR
- Not a directory (expected directory, got file or device).
- ENOTEMPTY
- Directory not empty (rmdir on non-empty directory).
- ENOTSUP
- Not supported (operation not supported by this filesystem/device).
- ENOTTY
- Not a typewriter (ioctl on non-TTY device).
- EPERM
- Operation not permitted (e.g., missing capability).
- EPIPE
- Broken pipe (write to pipe with no readers).
- ERANGE
- Result too large (numeric overflow in math operation).
- ESRCH
- No such process (invalid PID/TID).
- ETIMEDOUT
- Connection timed out (network or device timeout).