core/sys/unix: Add syscalls_linux.odin

Linux is in the unfortunate situation where the system call number is
architecture specific.  This consolidates the system call number
definitions in a single location, adds some wrappers, and hopefully
fixes the existing non-portable invocations of the syscall intrinsic.
This commit is contained in:
Yawning Angel
2021-11-17 14:00:00 +00:00
parent 6c4c9aef61
commit 61c581baeb
6 changed files with 101 additions and 52 deletions
+1 -3
View File
@@ -1,11 +1,9 @@
package sync
import "core:sys/unix"
import "core:intrinsics"
current_thread_id :: proc "contextless" () -> int {
SYS_GETTID :: 186
return int(intrinsics.syscall(SYS_GETTID))
return unix.sys_gettid()
}