diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2025-10-30 16:29:23 +0000 |
|---|---|---|
| committer | gingerBill <gingerBill@users.noreply.github.com> | 2025-10-30 16:29:23 +0000 |
| commit | efb553afadf92bfb0f889d12eacd5bff935495c0 (patch) | |
| tree | fa0a82048b46c6e6dbb136fc188a429588e31fd9 /base/runtime/os_specific_linux.odin | |
| parent | 816c47058da777bafb4bba17d0648a6e221b4a94 (diff) | |
Add `runtime.exit`
Diffstat (limited to 'base/runtime/os_specific_linux.odin')
| -rw-r--r-- | base/runtime/os_specific_linux.odin | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/base/runtime/os_specific_linux.odin b/base/runtime/os_specific_linux.odin index d7b7371a7..e24454bf3 100644 --- a/base/runtime/os_specific_linux.odin +++ b/base/runtime/os_specific_linux.odin @@ -24,3 +24,17 @@ _stderr_write :: proc "contextless" (data: []byte) -> (int, _OS_Errno) { } return ret, 0 } + + +_exit :: proc "contextless" (code: int) -> ! { + SYS_exit_group :: + 231 when ODIN_ARCH == .amd64 else + 248 when ODIN_ARCH == .arm32 else + 94 when ODIN_ARCH == .arm64 else + 252 when ODIN_ARCH == .i386 else + 94 when ODIN_ARCH == .riscv64 else + 0 + + intrinsics.syscall(uintptr(SYS_exit_group), i32(code)) + unreachable() +} |