mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
ext/pcntl: add pcntl_getcpu support for solaris.
using getcpuid having similar signature too. close GH-14188
This commit is contained in:
parent
46db8931f1
commit
19c8a10f3f
4 changed files with 23 additions and 3 deletions
2
NEWS
2
NEWS
|
@ -141,7 +141,7 @@ PHP NEWS
|
|||
. Added pcntl_getaffinity/pcntl_setaffinity. (David Carlier)
|
||||
. Updated pcntl_get_signal_handler signal id upper limit to be
|
||||
more in line with platforms limits. (David Carlier)
|
||||
. Added pcntl_getcpu for Linux/FreeBSD. (David Carlier)
|
||||
. Added pcntl_getcpu for Linux/FreeBSD/Solaris/Illumos. (David Carlier)
|
||||
. Added pcntl_getqos_class/pcntl_setqos_class for macOs. (David Carlier)
|
||||
. Added SIGCKPT/SIGCKPTEXIT constants for DragonFlyBSD. (David Carlier)
|
||||
|
||||
|
|
|
@ -694,7 +694,7 @@ static bool zend_call_stack_get_solaris_proc_maps(zend_call_stack *stack)
|
|||
struct rlimit rlim;
|
||||
char path[PATH_MAX];
|
||||
size_t size;
|
||||
ssize_t len;
|
||||
ssize_t len = -1;
|
||||
pid_t pid;
|
||||
int error, fd;
|
||||
|
||||
|
|
|
@ -7,7 +7,21 @@ if test "$PHP_PCNTL" != "no"; then
|
|||
AC_CHECK_FUNCS([fork], [], [AC_MSG_ERROR([pcntl: fork() not supported by this platform])])
|
||||
AC_CHECK_FUNCS([waitpid], [], [AC_MSG_ERROR([pcntl: waitpid() not supported by this platform])])
|
||||
AC_CHECK_FUNCS([sigaction], [], [AC_MSG_ERROR([pcntl: sigaction() not supported by this platform])])
|
||||
AC_CHECK_FUNCS([getpriority setpriority wait3 wait4 sigwaitinfo sigtimedwait unshare rfork forkx pidfd_open sched_setaffinity pthread_set_qos_class_self_np])
|
||||
AC_CHECK_FUNCS(m4_normalize([
|
||||
forkx
|
||||
getcpuid
|
||||
getpriority
|
||||
pidfd_open
|
||||
pthread_set_qos_class_self_np
|
||||
rfork
|
||||
sched_setaffinity
|
||||
setpriority
|
||||
sigwaitinfo
|
||||
sigtimedwait
|
||||
unshare
|
||||
wait3
|
||||
wait4
|
||||
]))
|
||||
|
||||
dnl if unsupported, -1 means automatically ENOSYS in this context
|
||||
AC_MSG_CHECKING([if sched_getcpu is supported])
|
||||
|
|
|
@ -78,6 +78,12 @@ typedef cpuset_t *cpu_set_t;
|
|||
#define HAVE_SCHED_SETAFFINITY 1
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_GETCPUID)
|
||||
#include <sys/processor.h>
|
||||
#define sched_getcpu getcpuid
|
||||
#define HAVE_SCHED_GETCPU 1
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_PTHREAD_SET_QOS_CLASS_SELF_NP)
|
||||
#include <pthread/qos.h>
|
||||
static zend_class_entry *QosClass_ce;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue