mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Add OpenBSD support to be able to retrieve the thread id
This commit is contained in:
parent
5e9ac43a7a
commit
2b7d43c46c
@ -37,6 +37,10 @@
|
||||
#include <lwp.h> // For _lwp_self()
|
||||
#endif
|
||||
|
||||
#if defined(__OpenBSD__)
|
||||
#include <unistd.h> // For getthrid()
|
||||
#endif
|
||||
|
||||
#if defined(__linux__)
|
||||
#include <sched.h> // For sched_getaffinity
|
||||
#include <sys/syscall.h> // For syscall codes
|
||||
@ -105,6 +109,8 @@ uint64_t llvm::get_threadid() {
|
||||
return uint64_t(pthread_getthreadid_np());
|
||||
#elif defined(__NetBSD__)
|
||||
return uint64_t(_lwp_self());
|
||||
#elif defined(__OpenBSD__)
|
||||
return uint64_t(getthrid());
|
||||
#elif defined(__ANDROID__)
|
||||
return uint64_t(gettid());
|
||||
#elif defined(__linux__)
|
||||
|
Loading…
Reference in New Issue
Block a user