Commit 7453c26e authored by Max Kellermann's avatar Max Kellermann

thread/Name: fall back to prctl()

parent b059ba69
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
#ifdef HAVE_PTHREAD_SETNAME_NP #ifdef HAVE_PTHREAD_SETNAME_NP
#include <pthread.h> #include <pthread.h>
#include <stdio.h> #include <stdio.h>
#elif defined(HAVE_PRCTL)
#include <sys/prctl.h>
#endif #endif
static inline void static inline void
...@@ -34,6 +36,8 @@ SetThreadName(const char *name) ...@@ -34,6 +36,8 @@ SetThreadName(const char *name)
#else #else
pthread_setname_np(pthread_self(), name); pthread_setname_np(pthread_self(), name);
#endif #endif
#elif defined(HAVE_PRCTL) && defined(PR_SET_NAME)
prctl(PR_SET_NAME, (unsigned long)name, 0, 0, 0);
#else #else
(void)name; (void)name;
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment