From c412c79c6995298cbfb4dc0ea44313bedfa1749c Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Thu, 8 Feb 2024 21:03:07 +0100 Subject: [PATCH] Fix undefined symbol pthread_attr_get_np on Solaris Solaris doesn't have pthread_attr_get_np(). Checked on Oracle Solaris 11.4. --- Zend/zend_call_stack.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Zend/zend_call_stack.c b/Zend/zend_call_stack.c index f24617d93f0df..a89e9898ee864 100644 --- a/Zend/zend_call_stack.c +++ b/Zend/zend_call_stack.c @@ -664,6 +664,7 @@ static bool zend_call_stack_get_netbsd(zend_call_stack *stack) #endif /* defined(__NetBSD__) */ #if defined(__sun) +# if defined(HAVE_PTHREAD_ATTR_GET_NP) && defined(HAVE_PTHREAD_ATTR_GETSTACK) static bool zend_call_stack_get_solaris_pthread(zend_call_stack *stack) { pthread_attr_t attr; @@ -694,6 +695,12 @@ static bool zend_call_stack_get_solaris_pthread(zend_call_stack *stack) return true; } +# else /* defined(HAVE_PTHREAD_ATTR_GET_NP) && defined(HAVE_PTHREAD_ATTR_GETSTACK) */ +static bool zend_call_stack_get_solaris_pthread(zend_call_stack *stack) +{ + return false; +} +# endif /* defined(HAVE_PTHREAD_ATTR_GET_NP) && defined(HAVE_PTHREAD_ATTR_GETSTACK) */ static bool zend_call_stack_get_solaris_proc_maps(zend_call_stack *stack) {