From 54248b18fea80dcb8b7e62550c8566df10e8e935 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Thu, 10 Dec 2020 14:25:32 -0400 Subject: 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. --- Zend/zend_execute_API.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zend/zend_execute_API.c') 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); -- cgit v1.2.1