mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-7.4'
This commit is contained in:
commit
d406751e49
2 changed files with 26 additions and 0 deletions
|
@ -1265,6 +1265,12 @@ static void pcntl_siginfo_to_zval(int signo, siginfo_t *siginfo, zval *user_sigi
|
|||
break;
|
||||
#endif
|
||||
}
|
||||
#if defined(SIGRTMIN) && defined(SIGRTMAX)
|
||||
if (SIGRTMIN <= signo && signo <= SIGRTMAX) {
|
||||
add_assoc_long_ex(user_siginfo, "pid", sizeof("pid")-1, siginfo->si_pid);
|
||||
add_assoc_long_ex(user_siginfo, "uid", sizeof("uid")-1, siginfo->si_uid);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
|
20
ext/pcntl/tests/pcntl_realtime_signal.phpt
Normal file
20
ext/pcntl/tests/pcntl_realtime_signal.phpt
Normal file
|
@ -0,0 +1,20 @@
|
|||
--TEST--
|
||||
pcntl_signal() context of realtime signal
|
||||
--SKIPIF--
|
||||
<?php if (!defined('SIGRTMIN')) die("skip realtime signal not supported"); ?>
|
||||
<?php if (!extension_loaded("pcntl")) print "skip"; ?>
|
||||
<?php if (!extension_loaded("posix")) die("skip posix extension not available"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
pcntl_signal(SIGRTMIN, function ($signo, $siginfo) {
|
||||
printf("got realtime signal from %s, ruid:%s\n", $siginfo['pid'] ?? '', $siginfo['uid'] ?? '');
|
||||
});
|
||||
posix_kill(posix_getpid(), SIGRTMIN);
|
||||
pcntl_signal_dispatch();
|
||||
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
%rgot realtime signal from \d+, ruid:\d+%r
|
||||
ok
|
Loading…
Add table
Add a link
Reference in a new issue