zend call stack for DragonFlyBSD. (#12325)

Shares the same codepaths as FreeBSD for the most part.
This commit is contained in:
David CARLIER 2023-10-01 13:12:14 +01:00 committed by GitHub
parent f10e1b8f59
commit 3944bb01eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -35,10 +35,10 @@
# include <sys/types.h> # include <sys/types.h>
# endif # endif
#endif /* ZEND_WIN32 */ #endif /* ZEND_WIN32 */
#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__NetBSD__) #if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
# include <pthread.h> # include <pthread.h>
#endif #endif
#ifdef __FreeBSD__ #if defined(__FreeBSD__) || defined(__DragonFly__)
# include <pthread_np.h> # include <pthread_np.h>
# include <sys/mman.h> # include <sys/mman.h>
# include <sys/sysctl.h> # include <sys/sysctl.h>
@ -251,7 +251,7 @@ static bool zend_call_stack_get_linux(zend_call_stack *stack)
} }
#endif /* __linux__ */ #endif /* __linux__ */
#ifdef __FreeBSD__ #if defined(__FreeBSD__) || defined(__DragonFly__)
static bool zend_call_stack_is_main_thread(void) static bool zend_call_stack_is_main_thread(void)
{ {
int is_main = pthread_main_np(); int is_main = pthread_main_np();

View file

@ -76,6 +76,9 @@ static inline size_t zend_call_stack_default_size(void)
#if defined(__FreeBSD__) || defined(__NetBSD__) #if defined(__FreeBSD__) || defined(__NetBSD__)
return 4 * 1024 * 1024; return 4 * 1024 * 1024;
#endif #endif
#if defined(__DragonFly__)
return 2 * 1024 * 1024;
#endif
#ifdef __OpenBSD__ #ifdef __OpenBSD__
return 512 * 1024; return 512 * 1024;
#endif #endif