summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPHO <pho@cielonegro.org>2021-05-05 16:49:21 +0900
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-07 20:06:43 -0400
commit39be32839e4622c6df2f0544f2ad6fc9ed51c81c (patch)
tree1761a7d22b3cf08ece16979f1cd537c4e85c051b /m4
parent740103c509767f901ebf955f326186f9eabc4a0e (diff)
downloadhaskell-39be32839e4622c6df2f0544f2ad6fc9ed51c81c.tar.gz
rts: Correctly call pthread_setname_np() on NetBSD
NetBSD supports pthread_setname_np() but it expects a printf-style format string and a string argument. Also use pthread for itimer on this platform.
Diffstat (limited to 'm4')
-rw-r--r--m4/fp_check_pthreads.m417
1 files changed, 17 insertions, 0 deletions
diff --git a/m4/fp_check_pthreads.m4 b/m4/fp_check_pthreads.m4
index 008b97d482..8160f76d4b 100644
--- a/m4/fp_check_pthreads.m4
+++ b/m4/fp_check_pthreads.m4
@@ -82,6 +82,23 @@ AC_DEFUN([FP_CHECK_PTHREADS],
AC_MSG_RESULT(no)
)
+ dnl NetBSD
+ AC_MSG_CHECKING([for pthread_setname_np (NetBSD)])
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM(
+ [[
+ #include <pthread.h>
+ ]],
+ [[pthread_setname_np(pthread_self(), "%s", "name");]]
+ )],
+ [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_PTHREAD_SETNAME_NP_NETBSD], [1],
+ [Define to 1 if you have the NetBSD version of pthread_setname_np])
+ ],
+ AC_MSG_RESULT([no])
+ )
+
dnl FreeBSD
AC_MSG_CHECKING([for pthread_set_name_np])
AC_LINK_IFELSE([