File tree 2 files changed +13
-2
lines changed 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,8 @@ PHP NEWS
125
125
- PCNTL:
126
126
. Added pcntl_setns for Linux. (David Carlier)
127
127
. Added pcntl_getaffinity/pcntl_setaffinity. (David Carlier)
128
+ . Updated pcntl_get_signal_handler signal id upper limit to be
129
+ more in line with platforms limits. (David Carlier)
128
130
129
131
- PCRE:
130
132
. Upgrade bundled pcre2lib to version 10.43. (nielsdos)
Original file line number Diff line number Diff line change @@ -692,8 +692,17 @@ PHP_FUNCTION(pcntl_signal_get_handler)
692
692
Z_PARAM_LONG (signo )
693
693
ZEND_PARSE_PARAMETERS_END ();
694
694
695
- if (signo < 1 || signo > 32 ) {
696
- zend_argument_value_error (1 , "must be between 1 and 32" );
695
+ // note: max signal on mac is SIGUSR2 (31), no real time signals.
696
+ int sigmax = NSIG - 1 ;
697
+ #if defined(SIGRTMAX )
698
+ // oddily enough, NSIG on freebsd reports only 32 whereas SIGRTMIN starts at 65.
699
+ if (sigmax < SIGRTMAX ) {
700
+ sigmax = SIGRTMAX ;
701
+ }
702
+ #endif
703
+
704
+ if (signo < 1 || signo > sigmax ) {
705
+ zend_argument_value_error (1 , "must be between 1 and %d" , sigmax );
697
706
RETURN_THROWS ();
698
707
}
699
708
You can’t perform that action at this time.
0 commit comments