summaryrefslogtreecommitdiff
path: root/ext/pcntl/tests
diff options
context:
space:
mode:
authorDavid Walker <dave@mudsite.com>2016-06-13 18:33:19 -0400
committerDavid Walker <dave@mudsite.com>2016-07-07 09:43:18 -0600
commitf64388e8c1686948d88401ae9871c87cb012b65f (patch)
tree494dcf851dc7cc7317e666817f6b62fd7880dc6b /ext/pcntl/tests
parentab304579ff046426f281e9a95abea8d611e38e1c (diff)
downloadphp-git-f64388e8c1686948d88401ae9871c87cb012b65f.tar.gz
pnctl_signal(): add siginfo to handler args
Feature will utilize already available siginfo parsing and extend the handler for signals to provide an array of the siginfo_t data. RFC:https://wiki.php.net/rfc/additional-context-in-pcntl-signal-handler
Diffstat (limited to 'ext/pcntl/tests')
-rw-r--r--ext/pcntl/tests/pcntl_signal.phpt7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/pcntl/tests/pcntl_signal.phpt b/ext/pcntl/tests/pcntl_signal.phpt
index 2db01305b5..a6441935c1 100644
--- a/ext/pcntl/tests/pcntl_signal.phpt
+++ b/ext/pcntl/tests/pcntl_signal.phpt
@@ -11,6 +11,12 @@ pcntl_signal(SIGTERM, function($signo){
posix_kill(posix_getpid(), SIGTERM);
pcntl_signal_dispatch();
+pcntl_signal(SIGUSR1, function($signo, $siginfo){
+ printf("got signal from %s\n", $siginfo['pid'] ?? 'nobody');
+});
+posix_kill(posix_getpid(), SIGUSR1);
+pcntl_signal_dispatch();
+
var_dump(pcntl_signal());
var_dump(pcntl_signal(SIGALRM, SIG_IGN));
var_dump(pcntl_signal(-1, -1));
@@ -24,6 +30,7 @@ echo "ok\n";
?>
--EXPECTF--
signal dispatched
+got signal from %r\d+|nobody%r
Warning: pcntl_signal() expects at least 2 parameters, 0 given in %s
NULL