diff options
author | Calvin Buckley <calvin@cmpct.info> | 2020-12-10 14:25:32 -0400 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-12-15 10:15:28 +0100 |
commit | 54248b18fea80dcb8b7e62550c8566df10e8e935 (patch) | |
tree | a2344cf32ed02e6263b8edceb688d20134f2a0fc /Zend | |
parent | 10c9d615dea8a21437443d76132f973c7f0c5da4 (diff) | |
download | php-git-54248b18fea80dcb8b7e62550c8566df10e8e935.tar.gz |
IBM i PASE doesn't support ITIMER_PROF
Like Cygwin, this platform needs to use a real-time timer.
This was based on a patch by @kadler, but it didn't handle unsetting
the timer, so the timeout would continue to be active, triggering
`hard_timeout` unexpectedly. The patch is fixed to handle unsetting.
Closes GH-6503.
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/zend_execute_API.c | 4 | ||||
-rw-r--r-- | Zend/zend_signal.c | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index a62b9292ec..f4f0fa14f1 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1294,7 +1294,7 @@ static void zend_set_timeout_ex(zend_long seconds, int reset_signals) /* {{{ */ t_r.it_value.tv_sec = seconds; t_r.it_value.tv_usec = t_r.it_interval.tv_sec = t_r.it_interval.tv_usec = 0; -# ifdef __CYGWIN__ +# if defined(__CYGWIN__) || defined(__PASE__) setitimer(ITIMER_REAL, &t_r, NULL); } signo = SIGALRM; @@ -1356,7 +1356,7 @@ void zend_unset_timeout(void) /* {{{ */ no_timeout.it_value.tv_sec = no_timeout.it_value.tv_usec = no_timeout.it_interval.tv_sec = no_timeout.it_interval.tv_usec = 0; -# ifdef __CYGWIN__ +# if defined(__CYGWIN__) || defined(__PASE__) setitimer(ITIMER_REAL, &no_timeout, NULL); # else setitimer(ITIMER_PROF, &no_timeout, NULL); diff --git a/Zend/zend_signal.c b/Zend/zend_signal.c index e69914752a..7e6eb18068 100644 --- a/Zend/zend_signal.c +++ b/Zend/zend_signal.c @@ -62,7 +62,8 @@ ZEND_API zend_signal_globals_t zend_signal_globals; static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context); static int zend_signal_register(int signo, void (*handler)(int, siginfo_t*, void*)); -#ifdef __CYGWIN__ +#if defined(__CYGWIN__) || defined(__PASE__) +/* Matches zend_excute_API.c; these platforms don't support ITIMER_PROF. */ #define TIMEOUT_SIG SIGALRM #else #define TIMEOUT_SIG SIGPROF |