Skip to content

Commit

Permalink
[llvm][Support] Determine the max thread length on Haiku (#107801)
Browse files Browse the repository at this point in the history
Haiku has pthread_setname_np() / pthread_getname_np().
  • Loading branch information
brad0 authored Sep 10, 2024
1 parent bece0d7 commit 1c334de
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions llvm/lib/Support/Unix/Threading.inc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
#include <unistd.h> // For syscall()
#endif

#if defined(__HAIKU__)
#include <OS.h> // For B_OS_NAME_LENGTH
#endif

namespace llvm {
pthread_t
llvm_execute_on_thread_impl(void *(*ThreadFunc)(void *), void *Arg,
Expand Down Expand Up @@ -139,6 +143,8 @@ uint64_t llvm::get_threadid() {
static constexpr uint32_t get_max_thread_name_length_impl() {
#if defined(PTHREAD_MAX_NAMELEN_NP)
return PTHREAD_MAX_NAMELEN_NP;
#elif defined(__HAIKU__)
return B_OS_NAME_LENGTH;
#elif defined(__APPLE__)
return 64;
#elif defined(__sun__) && defined(__svr4__)
Expand Down

0 comments on commit 1c334de

Please sign in to comment.