Skip to content

Commit 33fc712

Browse files
committed
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
1 parent 238045f commit 33fc712

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/Support/Unix/Threading.inc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ void llvm::get_thread_name(SmallVectorImpl<char> &Name) {
202202
char buf[len];
203203
::pthread_getname_np(::pthread_self(), buf, len);
204204

205+
Name.append(buf, buf + strlen(buf));
206+
#elif defined(__OpenBSD__)
207+
constexpr uint32_t len = get_max_thread_name_length_impl();
208+
char buf[len];
209+
::pthread_get_name_np(::pthread_self(), buf, len);
210+
205211
Name.append(buf, buf + strlen(buf));
206212
#elif defined(__linux__)
207213
#if HAVE_PTHREAD_GETNAME_NP

0 commit comments

Comments
 (0)