Skip to content

Commit 7c5d655

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: Use ITIMER_REAL for timeout handling on MacOS / Apple Silicon system
2 parents 2d66562 + 3b2764b commit 7c5d655

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Zend/zend_execute_API.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,7 +1569,9 @@ static void zend_set_timeout_ex(zend_long seconds, bool reset_signals) /* {{{ */
15691569
t_r.it_value.tv_sec = seconds;
15701570
t_r.it_value.tv_usec = t_r.it_interval.tv_sec = t_r.it_interval.tv_usec = 0;
15711571

1572-
# if defined(__CYGWIN__) || defined(__PASE__)
1572+
# if defined(__CYGWIN__) || defined(__PASE__) || (defined(__aarch64__) && defined(__APPLE__))
1573+
// ITIMER_PROF is broken in Apple Silicon system with MacOS >= 14
1574+
// See https://openradar.appspot.com/radar?id=5583058442911744.
15731575
setitimer(ITIMER_REAL, &t_r, NULL);
15741576
}
15751577
signo = SIGALRM;
@@ -1633,7 +1635,7 @@ void zend_unset_timeout(void) /* {{{ */
16331635

16341636
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;
16351637

1636-
# if defined(__CYGWIN__) || defined(__PASE__)
1638+
# if defined(__CYGWIN__) || defined(__PASE__) || (defined(__aarch64__) && defined(__APPLE__))
16371639
setitimer(ITIMER_REAL, &no_timeout, NULL);
16381640
# else
16391641
setitimer(ITIMER_PROF, &no_timeout, NULL);

0 commit comments

Comments
 (0)