pcntl_sigwaitinfo

(PHP 5 >= 5.3.0, PHP 7)

pcntl_sigwaitinfo锟饺达拷锟脚猴拷

说锟斤拷

pcntl_sigwaitinfo ( array $set [, array &$siginfo ] ) : int

pcntl_sigwaitinfo()锟斤拷锟斤拷锟斤拷停锟斤拷锟矫脚憋拷锟斤拷执锟斤拷直锟斤拷锟斤拷锟秸碉拷set 锟斤拷锟斤拷锟斤拷锟叫筹拷锟斤拷某锟斤拷锟脚号★拷只要锟斤拷锟叫碉拷一锟斤拷锟脚猴拷锟窖撅拷锟节等达拷状态(锟斤拷锟界: 通锟斤拷 pcntl_sigprocmask()锟斤拷锟斤拷锟斤拷锟斤拷)锟斤拷 锟斤拷锟斤拷pcntl_sigwaitinfo()锟酵伙拷锟斤拷锟教凤拷锟截★拷

锟斤拷锟斤拷

set

要锟饺达拷锟斤拷锟脚猴拷锟斤拷锟介。

siginfo

siginfo锟斤拷一锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷藕诺锟斤拷锟较拷锟�

锟斤拷锟斤拷元锟截伙拷为锟斤拷锟斤拷锟脚猴拷锟斤拷锟矫o拷

  • signo: 锟脚号憋拷锟�
  • errno: 锟斤拷锟斤拷锟斤拷
  • code: 锟脚号达拷锟斤拷

锟斤拷锟斤拷元锟截匡拷锟杰伙拷为SIGCHLD锟脚猴拷锟斤拷锟斤拷:

  • status: 锟剿筹拷锟斤拷值锟斤拷锟脚猴拷
  • utime: 锟矫伙拷锟斤拷锟侥碉拷时锟斤拷
  • stime: 系统锟斤拷锟节核o拷锟斤拷锟侥碉拷时锟斤拷
  • pid: 锟斤拷锟酵斤拷锟斤拷ID
  • uid: 锟斤拷锟酵斤拷锟教碉拷实锟斤拷锟矫伙拷ID

锟脚猴拷SIGILL, SIGFPE, SIGSEGV 锟斤拷 SIGBUS 锟斤拷锟杰会被锟斤拷锟矫碉拷元锟斤拷:

  • addr: 锟斤拷锟斤拷锟斤拷锟较碉拷锟节达拷位锟斤拷

锟斤拷锟杰伙拷为SIGPOLL 锟脚猴拷锟斤拷锟矫碉拷元锟截o拷

  • band: Band event
  • fd: 锟侥硷拷锟斤拷锟斤拷锟斤拷

锟斤拷锟斤拷值

锟缴癸拷时锟斤拷锟斤拷锟斤拷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);
?>

锟轿硷拷