Add some missing files to sync2 for linux and darwin

This commit is contained in:
gingerBill
2021-08-16 15:48:54 +01:00
parent 94d298755a
commit df159dbae7
3 changed files with 160 additions and 2 deletions
+15
View File
@@ -0,0 +1,15 @@
//+build linux
//+private
package sync2
// TODO(bill): remove libc
foreign import libc "system:c"
_current_thread_id :: proc "contextless" () -> int {
foreign libc {
syscall :: proc(number: i32, #c_vararg args: ..any) -> i32 ---
}
SYS_GETTID :: 186;
return int(syscall(SYS_GETTID));
}