diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2019-02-12 10:10:22 +0100 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-02-12 10:10:22 +0100 |
| commit | 97dd1591af3eee8ff43f77afc03013a29cdeb935 (patch) | |
| tree | 9164de1b1eb01689915ad68f65bd8f7776003c3d /ext/pcntl/tests | |
| parent | 8ed775f548d2535b87ff439f0b0a04b7770ed914 (diff) | |
| parent | b5cb3ac8ecab71bfe1eb7d5b2d7a48970e11a5b4 (diff) | |
| download | php-git-97dd1591af3eee8ff43f77afc03013a29cdeb935.tar.gz | |
Merge branch 'PHP-7.2' into PHP-7.3
Diffstat (limited to 'ext/pcntl/tests')
| -rw-r--r-- | ext/pcntl/tests/pcntl_realtime_signal.phpt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/pcntl/tests/pcntl_realtime_signal.phpt b/ext/pcntl/tests/pcntl_realtime_signal.phpt new file mode 100644 index 0000000000..212f15e03b --- /dev/null +++ b/ext/pcntl/tests/pcntl_realtime_signal.phpt @@ -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 |
