mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
ext/pcntl pcntl_signal_get_handler update.
The situation varies from platform to another, thus taking in account the complexity of it. Close GH-13902
This commit is contained in:
2
NEWS
2
NEWS
@@ -125,6 +125,8 @@ PHP NEWS
|
||||
- PCNTL:
|
||||
. Added pcntl_setns for Linux. (David Carlier)
|
||||
. Added pcntl_getaffinity/pcntl_setaffinity. (David Carlier)
|
||||
. Updated pcntl_get_signal_handler signal id upper limit to be
|
||||
more in line with platforms limits. (David Carlier)
|
||||
|
||||
- PCRE:
|
||||
. Upgrade bundled pcre2lib to version 10.43. (nielsdos)
|
||||
|
||||
@@ -692,8 +692,17 @@ PHP_FUNCTION(pcntl_signal_get_handler)
|
||||
Z_PARAM_LONG(signo)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
|
||||
if (signo < 1 || signo > 32) {
|
||||
zend_argument_value_error(1, "must be between 1 and 32");
|
||||
// note: max signal on mac is SIGUSR2 (31), no real time signals.
|
||||
int sigmax = NSIG - 1;
|
||||
#if defined(SIGRTMAX)
|
||||
// oddily enough, NSIG on freebsd reports only 32 whereas SIGRTMIN starts at 65.
|
||||
if (sigmax < SIGRTMAX) {
|
||||
sigmax = SIGRTMAX;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (signo < 1 || signo > sigmax) {
|
||||
zend_argument_value_error(1, "must be between 1 and %d", sigmax);
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user