See https://gitlab.gnome.org/GNOME/gtk/issues/1846 --- configure 2018-09-21 05:47:02.000000000 -0400 +++ configure 2019-04-25 12:16:07.558467000 -0400 @@ -27503,13 +27503,14 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_setname_np(pthread_t, const char*)" >&5 -$as_echo_n "checking for pthread_setname_np(pthread_t, const char*)... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_set_name_np(pthread_t, const char*)" >&5 +$as_echo_n "checking for pthread_set_name_np(pthread_t, const char*)... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include +#include int main () { -pthread_setname_np(pthread_self(), "example") +pthread_set_name_np(pthread_self(), "example") ; return 0; @@ -27528,13 +27529,14 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_getname_np(pthread_t, name, len)" >&5 -$as_echo_n "checking for pthread_getname_np(pthread_t, name, len)... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_get_name_np(pthread_t, name, len)" >&5 +$as_echo_n "checking for pthread_get_name_np(pthread_t, name, len)... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include +#include int main () { -char name[16]; pthread_getname_np(pthread_self(), name, 16); +char name[16]; pthread_get_name_np(pthread_self(), name, 16); ; return 0; --- glib/gthread-posix.c 2018-08-15 12:22:08.000000000 -0400 +++ glib/gthread-posix.c 2019-04-25 12:53:45.004258000 -0400 @@ -54,4 +54,12 @@ #include #include +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFlyBSD__) +# include +# if defined(__NetBSD__) +# define pthread_setname_np(t, s) pthread_set_name_np(t, s, NULL) +# else +# define pthread_setname_np pthread_set_name_np +# endif +#endif #include --- glib/tests/thread.c 2018-09-21 05:29:23.000000000 -0400 +++ glib/tests/thread.c 2019-04-25 13:00:10.190807000 -0400 @@ -40,4 +40,8 @@ #ifdef THREADS_POSIX #include +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFlyBSD__) +# include +# define pthread_getname_np pthread_get_name_np +#endif #endif