Index: compiler-rt/trunk/lib/safestack/safestack.cc =================================================================== --- compiler-rt/trunk/lib/safestack/safestack.cc +++ compiler-rt/trunk/lib/safestack/safestack.cc @@ -151,7 +151,7 @@ void *stack_base; size_t size; pid_t pid; - pid_t tid; + ThreadId tid; }; /// Linked list of unsafe stacks for threads that are exiting. We delay @@ -174,7 +174,7 @@ pthread_mutex_unlock(&thread_stacks_mutex); pid_t pid = getpid(); - pid_t tid = GetTid(); + ThreadId tid = GetTid(); // Free stacks for dead threads thread_stack_ll **stackp = &temp_stacks; Index: compiler-rt/trunk/lib/safestack/safestack_platform.h =================================================================== --- compiler-rt/trunk/lib/safestack/safestack_platform.h +++ compiler-rt/trunk/lib/safestack/safestack_platform.h @@ -16,13 +16,20 @@ #include "sanitizer_common/sanitizer_platform.h" +#include #include #include #include +#if SANITIZER_NETBSD +#include +#endif + namespace safestack { -inline pid_t GetTid() { +using ThreadId = uint64_t; + +inline ThreadId GetTid() { #if SANITIZER_NETBSD return _lwp_self(); #elif SANITIZER_FREEBSD @@ -38,7 +45,7 @@ #endif } -inline int TgKill(pid_t pid, pid_t tid, int sig) { +inline int TgKill(pid_t pid, ThreadId tid, int sig) { #if SANITIZER_NETBSD (void)pid; return _lwp_kill(tid, sig);