(PHP 5 >= 5.3.0, PHP 7)
pcntl_sigwaitinfo — 锟饺达拷锟脚猴拷
$set
[, array &$siginfo
] ) : int
pcntl_sigwaitinfo()锟斤拷锟斤拷锟斤拷停锟斤拷锟矫脚憋拷锟斤拷执锟斤拷直锟斤拷锟斤拷锟秸碉拷set
锟斤拷锟斤拷锟斤拷锟叫筹拷锟斤拷某锟斤拷锟脚号★拷只要锟斤拷锟叫碉拷一锟斤拷锟脚猴拷锟窖撅拷锟节等达拷状态(锟斤拷锟界: 通锟斤拷
pcntl_sigprocmask()锟斤拷锟斤拷锟斤拷锟斤拷)锟斤拷
锟斤拷锟斤拷pcntl_sigwaitinfo()锟酵伙拷锟斤拷锟教凤拷锟截★拷
set
要锟饺达拷锟斤拷锟脚猴拷锟斤拷锟介。
siginfo
siginfo
锟斤拷一锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷藕诺锟斤拷锟较拷锟�
锟斤拷锟斤拷元锟截伙拷为锟斤拷锟斤拷锟脚猴拷锟斤拷锟矫o拷
锟斤拷锟斤拷元锟截匡拷锟杰伙拷为SIGCHLD
锟脚猴拷锟斤拷锟斤拷:
锟脚猴拷SIGILL
,
SIGFPE
, SIGSEGV
锟斤拷
SIGBUS
锟斤拷锟杰会被锟斤拷锟矫碉拷元锟斤拷:
锟斤拷锟杰伙拷为SIGPOLL
锟脚猴拷锟斤拷锟矫碉拷元锟截o拷
锟缴癸拷时锟斤拷锟斤拷锟斤拷pcntl_sigwaitinfo()锟斤拷锟斤拷一锟斤拷锟脚号憋拷拧锟�
Example #1 pcntl_sigwaitinfo() example
<?php
echo "Blocking SIGHUP signal\n";
pcntl_sigprocmask(SIG_BLOCK, array(SIGHUP));
echo "Sending SIGHUP to self\n";
posix_kill(posix_getpid(), SIGHUP);
echo "Waiting for signals\n";
$info = array();
pcntl_sigwaitinfo(array(SIGHUP), $info);
?>