From a14deb22e0748cea208badc2f587132cee95ab4b Mon Sep 17 00:00:00 2001 From: Nick Connolly Date: Thu, 18 Feb 2021 17:36:52 +0000 Subject: [PATCH] lib/event: improve portability In _set_thread_name, use pthread_setname_np as the default for platforms that are not Linux or FreeBSD; it's the most common 'non-portable' pthread extension used to set the thread name. Signed-off-by: Nick Connolly Change-Id: Ia841166f0537cd1303eded15bc7ef1a9f03e3b6e Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6465 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- lib/event/reactor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/event/reactor.c b/lib/event/reactor.c index 91564d721..b70b56b72 100644 --- a/lib/event/reactor.c +++ b/lib/event/reactor.c @@ -648,7 +648,7 @@ _set_thread_name(const char *thread_name) #elif defined(__FreeBSD__) pthread_set_name_np(pthread_self(), thread_name); #else -#error missing platform support for thread name + pthread_setname_np(pthread_self(), thread_name); #endif }