mirror of
https://github.com/php/php-src.git
synced 2024-11-23 01:44:06 +08:00
Fix Solaris 10 build: missing libproc.h (#15525)
The libproc.h header file was added on Solaris as of 11.4. * Also add guard check to the entire function * When libproc.h isn't available also sys/procfs.h is redundant * Move the <sys/lwp.h> out of the guard * Exclude more stuff from Solaris 10
This commit is contained in:
parent
0c73553959
commit
f952263bcd
@ -133,7 +133,10 @@ dnl
|
||||
AC_DEFUN([ZEND_INIT], [dnl
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
|
||||
AC_CHECK_HEADERS([cpuid.h])
|
||||
AC_CHECK_HEADERS(m4_normalize([
|
||||
cpuid.h
|
||||
libproc.h
|
||||
]))
|
||||
|
||||
dnl Check for library functions.
|
||||
AC_CHECK_FUNCS(m4_normalize([
|
||||
|
@ -64,10 +64,12 @@ typedef int boolean_t;
|
||||
#include <sys/syscall.h>
|
||||
#endif
|
||||
#ifdef __sun
|
||||
#define _STRUCTURED_PROC 1
|
||||
#include <sys/lwp.h>
|
||||
#include <sys/procfs.h>
|
||||
#include <libproc.h>
|
||||
# include <sys/lwp.h>
|
||||
# ifdef HAVE_LIBPROC_H
|
||||
# define _STRUCTURED_PROC 1
|
||||
# include <sys/procfs.h>
|
||||
# include <libproc.h>
|
||||
# endif
|
||||
#include <thread.h>
|
||||
#endif
|
||||
|
||||
@ -699,6 +701,7 @@ static bool zend_call_stack_get_solaris_pthread(zend_call_stack *stack)
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBPROC_H
|
||||
static bool zend_call_stack_get_solaris_proc_maps(zend_call_stack *stack)
|
||||
{
|
||||
char buffer[4096];
|
||||
@ -771,12 +774,15 @@ end:
|
||||
close(fd);
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
|
||||
static bool zend_call_stack_get_solaris(zend_call_stack *stack)
|
||||
{
|
||||
#ifdef HAVE_LIBPROC_H
|
||||
if (_lwp_self() == 1) {
|
||||
return zend_call_stack_get_solaris_proc_maps(stack);
|
||||
}
|
||||
#endif
|
||||
return zend_call_stack_get_solaris_pthread(stack);
|
||||
}
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user