Add runtime.exit

This commit is contained in:
gingerBill
2025-10-30 16:29:23 +00:00
parent 816c47058d
commit efb553afad
10 changed files with 73 additions and 0 deletions
+14
View File
@@ -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()
}