Initial changes to support systems with single arg pthread_setname_np()

This commit is contained in:
Brad Keifer
2025-11-05 11:36:37 +11:00
parent ffa88286e4
commit 28528abbcd
3 changed files with 33 additions and 13 deletions

View File

@@ -80,8 +80,19 @@ AC_SEARCH_LIBS([pthread_setname_np], [pthread],
AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <pthread.h>]],
[[pthread_setname_np(pthread_self(), "name");]])],
[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_PTHREAD_SETNAME_NP], 1,
[Define to 1 if you have pthread_setname_np])],
AC_DEFINE([HAVE_PTHREAD_SETNAME_NP_2], 1,
[Define to 1 if you have pthread_setname_np with 2 args])],
[AC_MSG_RESULT([[no]])])],
[AC_SEARCH_LIBS([pthread_set_name_np], [pthread],
[AC_CHECK_FUNCS([pthread_set_name_np])])])
AC_SEARCH_LIBS([pthread_setname_np], [pthread],
[dnl Validate pthread_setname_np with 1 arg (some have 2)
AC_MSG_CHECKING([[for single-parameter pthread_setname_np]])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <pthread.h>]],
[[pthread_setname_np("name");]])],
[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_PTHREAD_SETNAME_NP_1], 1,
[Define to 1 if you have pthread_setname_np with 1 arg])],
[AC_MSG_RESULT([[no]])])],
[AC_SEARCH_LIBS([pthread_set_name_np], [pthread],
[AC_CHECK_FUNCS([pthread_set_name_np])])])
@@ -94,6 +105,7 @@ AC_SEARCH_LIBS([pthread_getname_np], [pthread],
AC_SEARCH_LIBS([pthread_getthreadid_np], [pthread],
[AC_DEFINE([HAVE_PTHREAD_GETTHREADID_NP], 1,
[Define to 1 if you have pthread_getthreadid_np])])
AC_SEARCH_LIBS([uuid_generate_random], [uuid],
[AC_DEFINE([HAVE_UUID], 1,
[Define to 1 if you have uuid_generate_random])])