__NR_gettid as const on amd64 (#7460)

This commit is contained in:
Jacek Sieka
2018-04-06 16:07:36 +08:00
committed by Andreas Rumpf
parent e336e6609c
commit 4d6456d029

View File

@@ -642,7 +642,10 @@ when defined(windows):
elif defined(linux):
proc syscall(arg: clong): clong {.varargs, importc: "syscall", header: "<unistd.h>".}
var NR_gettid {.importc: "__NR_gettid", header: "<sys/syscall.h>".}: int
when defined(amd64):
const NR_gettid = clong(186)
else:
var NR_gettid {.importc: "__NR_gettid", header: "<sys/syscall.h>".}: clong
proc getThreadId*(): int =
## get the ID of the currently running thread.