Skip to content

Commit df94877

Browse files
committed
[lldb] [test] Implement getting thread ID on FreeBSD
Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.llvm.org/D126982
1 parent 79f1159 commit df94877

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

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ int pthread_threadid_np(pthread_t, __uint64_t *);
99
#elif defined(__linux__)
1010
#include <sys/syscall.h>
1111
#include <unistd.h>
12+
#elif defined(__FreeBSD__)
13+
#include <pthread_np.h>
1214
#elif defined(__NetBSD__)
1315
#include <lwp.h>
1416
#elif defined(_WIN32)
@@ -22,6 +24,8 @@ inline uint64_t get_thread_id() {
2224
return tid;
2325
#elif defined(__linux__)
2426
return syscall(__NR_gettid);
27+
#elif defined(__FreeBSD__)
28+
return static_cast<uint64_t>(pthread_getthreadid_np());
2529
#elif defined(__NetBSD__)
2630
// Technically lwpid_t is 32-bit signed integer
2731
return static_cast<uint64_t>(_lwp_self());

0 commit comments

Comments
 (0)