Commit 33fc712a authored by Hans Wennborg's avatar Hans Wennborg
Browse files

Merging r353367:

------------------------------------------------------------------------
r353367 | brad | 2019-02-07 03:06:58 +0100 (Thu, 07 Feb 2019) | 2 lines

Add OpenBSD support to be able to get the thread name

------------------------------------------------------------------------

llvm-svn: 353388
parent 238045f8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -202,6 +202,12 @@ void llvm::get_thread_name(SmallVectorImpl<char> &Name) {
  char buf[len];
  ::pthread_getname_np(::pthread_self(), buf, len);

  Name.append(buf, buf + strlen(buf));
#elif defined(__OpenBSD__)
  constexpr uint32_t len = get_max_thread_name_length_impl();
  char buf[len];
  ::pthread_get_name_np(::pthread_self(), buf, len);

  Name.append(buf, buf + strlen(buf));
#elif defined(__linux__)
#if HAVE_PTHREAD_GETNAME_NP