From 3699b74ebb3eab06a8902f44863f6534bca35c2f Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Mon, 24 Jun 2013 15:06:40 -0700 Subject: [PATCH] Alternate thread naming for older GLIBC --- modules/beast_core/native/beast_posix_SharedCode.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/beast_core/native/beast_posix_SharedCode.h b/modules/beast_core/native/beast_posix_SharedCode.h index 41051e2bf..56d017b97 100644 --- a/modules/beast_core/native/beast_posix_SharedCode.h +++ b/modules/beast_core/native/beast_posix_SharedCode.h @@ -870,8 +870,12 @@ void Thread::setCurrentThreadName (const String& name) { [[NSThread currentThread] setName: beastStringToNS (name)]; } - #elif BEAST_LINUX && (__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2012 - pthread_setname_np (pthread_self(), name.toRawUTF8()); + #elif BEAST_LINUX + #if (__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2012 + pthread_setname_np (pthread_self(), name.toRawUTF8()); + #else + prctl (PR_SET_NAME, name.toRawUTF8(), 0, 0, 0); + #endif #endif }