1--TEST-- 2pcntl_signal() context of realtime signal 3--SKIPIF-- 4<?php if (!defined('SIGRTMIN')) die("skip realtime signal not supported"); ?> 5<?php if (!extension_loaded("pcntl")) print "skip"; ?> 6<?php if (!extension_loaded("posix")) die("skip posix extension not available"); ?> 7--FILE-- 8<?php 9 10pcntl_signal(SIGRTMIN, function ($signo, $siginfo) { 11 printf("got realtime signal from %s, ruid:%s\n", $siginfo['pid'] ?? '', $siginfo['uid'] ?? ''); 12}); 13posix_kill(posix_getpid(), SIGRTMIN); 14pcntl_signal_dispatch(); 15 16echo "ok\n"; 17?> 18--EXPECTF-- 19%rgot realtime signal from \d+, ruid:\d+%r 20ok 21