diff options
Diffstat (limited to 'lib/frr_pthread.c')
| -rw-r--r-- | lib/frr_pthread.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/frr_pthread.c b/lib/frr_pthread.c index 7cae889ca9..d48b23f38a 100644 --- a/lib/frr_pthread.c +++ b/lib/frr_pthread.c @@ -166,10 +166,14 @@ int frr_pthread_set_name(struct frr_pthread *fpt, const char *name, pthread_mutex_lock(&fpt->mtx); snprintf(fpt->os_name, OS_THREAD_NAMELEN, "%s", os_name); pthread_mutex_unlock(&fpt->mtx); -#ifdef GNU_LINUX +#ifdef HAVE_PTHREAD_SETNAME_NP +# ifdef GNU_LINUX ret = pthread_setname_np(fpt->thread, fpt->os_name); -#elif defined(OPEN_BSD) - ret = pthread_set_name_np(fpt->thread, fpt->os_name); +# else /* NetBSD */ + ret = pthread_setname_np(fpt->thread, fpt->os_name, NULL); +# endif +#elif defined(HAVE_PTHREAD_SET_NAME_NP) + pthread_set_name_np(fpt->thread, fpt->os_name); #endif } |
