We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 365e211 commit 3dc007eCopy full SHA for 3dc007e
ext/pcntl/pcntl.c
@@ -692,8 +692,17 @@ PHP_FUNCTION(pcntl_signal_get_handler)
692
Z_PARAM_LONG(signo)
693
ZEND_PARSE_PARAMETERS_END();
694
695
- if (signo < 1 || signo > 32) {
696
- zend_argument_value_error(1, "must be between 1 and 32");
+ // note: max signal on mac is SIGUSR2 (31), no real time signals.
+ static 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);
706
RETURN_THROWS();
707
}
708
0 commit comments