From 7453c26ec4838760dec767b2f99afff9eb537d53 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 1 Mar 2014 23:47:46 +0100 Subject: thread/Name: fall back to prctl() --- src/thread/Name.hxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/thread') diff --git a/src/thread/Name.hxx b/src/thread/Name.hxx index f86fc6e42..284d1e147 100644 --- a/src/thread/Name.hxx +++ b/src/thread/Name.hxx @@ -23,6 +23,8 @@ #ifdef HAVE_PTHREAD_SETNAME_NP #include #include +#elif defined(HAVE_PRCTL) +#include #endif static inline void @@ -34,6 +36,8 @@ SetThreadName(const char *name) #else pthread_setname_np(pthread_self(), name); #endif +#elif defined(HAVE_PRCTL) && defined(PR_SET_NAME) + prctl(PR_SET_NAME, (unsigned long)name, 0, 0, 0); #else (void)name; #endif -- cgit v1.2.3