From 82f1df9c40edc99a2d68499f363161e5b0bef849 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Fri, 1 Jun 2018 14:01:11 -1000 Subject: [PATCH] Use prctl on Linux to set thread name --- lib/logvisor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/logvisor.cpp b/lib/logvisor.cpp index 79be569..410e8f9 100644 --- a/lib/logvisor.cpp +++ b/lib/logvisor.cpp @@ -15,6 +15,9 @@ #include #include #include +#if __linux__ +#include +#endif #endif #include @@ -61,7 +64,7 @@ void RegisterThreadName(const char* name) #if __APPLE__ pthread_setname_np(name); #elif __linux__ - pthread_setname_np(pthread_self(), name); + prctl(PR_SET_NAME, name); #elif _MSC_VER struct {