]> granicus.if.org Git - php/commitdiff
IBM i PASE doesn't support ITIMER_PROF
authorCalvin Buckley <calvin@cmpct.info>
Thu, 10 Dec 2020 18:25:32 +0000 (14:25 -0400)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 15 Dec 2020 09:15:28 +0000 (10:15 +0100)
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
Zend/zend_signal.c

index a62b9292ece54ce7216c06d8d2b1c59c60d3bba2..f4f0fa14f1d3f3cf472c9f897db618412c1197e0 100644 (file)
@@ -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);
index e69914752aca19be63286fe6a7ce57bf871bddfe..7e6eb18068e06825104c069374775f475399252b 100644 (file)
@@ -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