diff options
author | Yuriy Glukhov <yglukhov@users.noreply.github.com> | 2017-02-04 22:18:54 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-02-04 21:18:54 +0100 |
commit | 3978845266d154c9dba42a8d17266f057a52d90f (patch) | |
tree | fec442fd56d7286919b294ee300cb7ada02c1223 /lib | |
parent | abaf5d0bdba3a4908eec65199867831141ed8a55 (diff) | |
download | Nim-3978845266d154c9dba42a8d17266f057a52d90f.tar.gz |
Use __NR_gettid instead of SYS_gettid (#5338)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system/threads.nim | 6 |
1 files changed, 3 insertions, 3 deletions
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: "<unistd.h>".} - var SYS_gettid {.importc, header: "<sys/syscall.h>".}: int + proc syscall(arg: clong): clong {.varargs, importc: "syscall", header: "<unistd.h>".} + var NR_gettid {.importc: "__NR_gettid", header: "<sys/syscall.h>".}: int #type Pid {.importc: "pid_t", header: "<sys/types.h>".} = distinct int #proc gettid(): Pid {.importc, header: "<sys/types.h>".} 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".} |