From 00699e9be5fd273b526f0d04c6c1ea79a51bd3ff Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Wed, 11 Apr 2018 09:52:23 -0400
Subject: [PATCH 2/2] SLES11: Hackily avoid pthread_set_name_np on linux

---
 src/thread.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/thread.cpp b/src/thread.cpp
index a1086b0c..c7b88e5d 100644
--- a/src/thread.cpp
+++ b/src/thread.cpp
@@ -32,6 +32,10 @@
 #include "thread.hpp"
 #include "err.hpp"
 
+#if defined(__linux__)
+#include <sys/prctl.h>
+#endif
+
 bool zmq::thread_t::get_started () const
 {
     return started;
@@ -308,6 +312,11 @@ void zmq::thread_t::setThreadName (const char *name_)
     if (!name_)
         return;
 
+/* Conda SLES11 support hack. Never to be upstreamed */
+#if defined(__linux__)
+    prctl (PR_SET_NAME, name_, 0, 0, 0, 0);
+    return;
+#else
 #if defined(ZMQ_HAVE_PTHREAD_SETNAME_1)
     int rc = pthread_setname_np (name_);
     if (rc)
@@ -323,6 +332,7 @@ void zmq::thread_t::setThreadName (const char *name_)
 #elif defined(ZMQ_HAVE_PTHREAD_SET_NAME)
     pthread_set_name_np (descriptor, name_);
 #endif
+#endif
 }
 
 #endif
-- 
2.16.1

