Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimeon Krastnikov2022-09-02 08:03:58 +0000
committerSimeon Krastnikov2022-09-02 08:04:01 +0000
commit8bf7ff927c1b08ad50f98f597c40c0759de8df41 (patch)
tree2e21e2ed1251046d095c43cece9d8e2b69fc216c
parent3d0ba1e2de09f29c090c656b04551ea672ea7421 (diff)
downloadorg.eclipse.tcf.agent-8bf7ff927c1b08ad50f98f597c40c0759de8df41.tar.gz
org.eclipse.tcf.agent-8bf7ff927c1b08ad50f98f597c40c0759de8df41.tar.xz
org.eclipse.tcf.agent-8bf7ff927c1b08ad50f98f597c40c0759de8df41.zip
TCF Agent: check glibc version when calling pthread_setname_np()
Support was added in glibc 2.12. Change-Id: I10c9b44c347c209a25daf319dff1db868feb6635
-rw-r--r--agent/tcf/framework/mdep.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/agent/tcf/framework/mdep.c b/agent/tcf/framework/mdep.c
index 962d1ce7..4a5b69e1 100644
--- a/agent/tcf/framework/mdep.c
+++ b/agent/tcf/framework/mdep.c
@@ -2040,7 +2040,8 @@ int tcf_set_thread_name(const char * name) {
loc_free(w_name);
return error;
-#elif defined(_GNU_SOURCE)
+#elif defined(_GNU_SOURCE) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
+ /* pthread_setname_np was added in glibc 2.12 */
return pthread_setname_np(pthread_self(), name);
#else
return 0;

Back to the top