feat: unify system status codes

This commit is contained in:
daniel committed 2026-09-30 09:43:18 +02:00
1 parent 93894b8fe5
commit 8a3ffb2be1
46 files changed
+1499 -489

No files matched your search

+23
View File
@@ -2,8 +2,31 @@
All syscalls are available through `#include <montauk/syscall.h>` in the `montauk` namespace. The syscall layer provides `syscall0()` through `syscall6()` primitives using AMD64 calling conventions. All raw syscalls return `int64_t`.
## Status Codes
| Code | Value | Meaning |
|------|-------|---------|
| `Success` | 0 | The call succeeded |
| `GenericFailure` | -1 | Unspecified failure |
| `PermissionDenied` | -2 | The object belongs to another process or the handle lacks the right |
| `CapabilityDenied` | -3 | The caller lacks (or was refused consent for) a required capability |
| `SystemIntegrityError` | -4 | The path is protected (ProtectedPaths) and the caller may not modify it |
| `BadPointer` | -5 | A user pointer or buffer range is invalid |
| `InvalidArgument` | -6 | An argument, id, or handle is invalid |
| `UnsupportedOp` | -7 | The operation is not supported here |
| `NoDevice` | -8 | The required device is absent or not initialized |
| `IoFailure` | -9 | Device I/O failed |
| `BadInvocation` | -10 | Unknown syscall number |
| `NoSuchPath` | -11 | The path does not exist |
| `Busy` | -12 | The resource is in use or its queue is full |
| `BufferTooSmall` | -13 | The output buffer is too small; retry with a larger one |
| `OutOfMemory` | -14 | Memory could not be allocated |
The Wi-Fi (`WIFI_ERR_*`) and USB (`USB_ERR_*`) syscalls keep their own error codes.
## Table of Contents
- [Status Codes](#status-codes)
- [Process Management](#process-management)
- [File System](#file-system)
- [Memory](#memory)