Skip to content

Commit 9ba5b52

Browse files
authored
[lldb][test] Implement getting thread ID on OpenBSD (llvm#71129)
1 parent c42d006 commit 9ba5b52

File tree

1 file changed

+4
-0
lines changed
  • lldb/packages/Python/lldbsuite/test/make

1 file changed

+4
-0
lines changed

lldb/packages/Python/lldbsuite/test/make/thread.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ int pthread_threadid_np(pthread_t, __uint64_t *);
1313
#include <pthread_np.h>
1414
#elif defined(__NetBSD__)
1515
#include <lwp.h>
16+
#elif defined(__OpenBSD__)
17+
#include <unistd.h>
1618
#elif defined(_WIN32)
1719
#include <windows.h>
1820
#endif
@@ -29,6 +31,8 @@ inline uint64_t get_thread_id() {
2931
#elif defined(__NetBSD__)
3032
// Technically lwpid_t is 32-bit signed integer
3133
return static_cast<uint64_t>(_lwp_self());
34+
#elif defined(__OpenBSD__)
35+
return static_cast<uint64_t>(getthrid());
3236
#elif defined(_WIN32)
3337
return static_cast<uint64_t>(::GetCurrentThreadId());
3438
#else

0 commit comments

Comments
 (0)