aboutsummaryrefslogtreecommitdiff
path: root/core/sync/sync2/primitives_linux.odin
blob: 0a5da08804aa79078e1f7b12387e480af7202c72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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));
}