File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -692,8 +692,21 @@ 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
+ #if !defined(__APPLE__ )
696
+ static int sigmax = NSIG ;
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
+ #else
704
+ // max signal on mac is SIGUSR2 (31), no real time signals.
705
+ static int sigmax = NSIG - 1 ;
706
+ #endif
707
+
708
+ if (signo < 1 || signo > sigmax ) {
709
+ zend_argument_value_error (1 , "must be between 1 and %d" , sigmax );
697
710
RETURN_THROWS ();
698
711
}
699
712
You can’t perform that action at this time.
0 commit comments