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
}
}
/* }}} */
--- /dev/null
+--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