From 3978845266d154c9dba42a8d17266f057a52d90f Mon Sep 17 00:00:00 2001 From: Yuriy Glukhov Date: Sat, 4 Feb 2017 22:18:54 +0200 Subject: Use __NR_gettid instead of SYS_gettid (#5338) --- lib/system/threads.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/system/threads.nim b/lib/system/threads.nim index 3dadfc683..e8b34bf2e 100644 --- a/lib/system/threads.nim +++ b/lib/system/threads.nim @@ -195,15 +195,15 @@ else: importc: "pthread_setaffinity_np", header: pthreadh.} when defined(linux): - proc syscall(arg: int): int {.varargs, importc: "syscall", header: "".} - var SYS_gettid {.importc, header: "".}: int + proc syscall(arg: clong): clong {.varargs, importc: "syscall", header: "".} + var NR_gettid {.importc: "__NR_gettid", header: "".}: int #type Pid {.importc: "pid_t", header: "".} = distinct int #proc gettid(): Pid {.importc, header: "".} proc getThreadId*(): int = ## get the ID of the currently running thread. - result = int(syscall(SYS_gettid)) + result = int(syscall(NR_gettid)) elif defined(macosx) or defined(bsd): proc pthread_threadid_np(y: pointer; x: var uint64): cint {.importc, header: "pthread.h".} -- cgit 1.4.1-2-gfad0