summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Thibault <[email protected]>2018-01-13 12:33:15 +0100
committerJose Fonseca <[email protected]>2018-01-22 21:12:41 +0000
commit9131e6d3c2dcc30260e23f2232b44c8cffc6f315 (patch)
treef6c5fdb70d3e540229744c1328860587bddc1515 /src
parentdcbb224c688bfdacb76107a9816647f64088e67e (diff)
u_thread: Use pthread_setname_np on linux only.
pthread_setname_np was added in glibc 2.12 for the Linux port only, other ports do not necessarily have it. Signed-off-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/util/u_thread.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/u_thread.h b/src/util/u_thread.h
index 26cc0b0934b..8c6e0bdc59e 100644
--- a/src/util/u_thread.h
+++ b/src/util/u_thread.h
@@ -62,7 +62,8 @@ static inline void u_thread_setname( const char *name )
{
#if defined(HAVE_PTHREAD)
# if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__) && \
- (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
+ (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12)) && \
+ defined(__linux__)
pthread_setname_np(pthread_self(), name);
# endif
#endif