<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.pcntl-sigwaitinfo" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>pcntl_sigwaitinfo</refname>
  <refpurpose>Waits for signals</refpurpose>
 </refnamediv>
 
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type class="union"><type>int</type><type>false</type></type><methodname>pcntl_sigwaitinfo</methodname>
   <methodparam><type>array</type><parameter>signals</parameter></methodparam>
   <methodparam choice="opt"><type>array</type><parameter role="reference">info</parameter><initializer>[]</initializer></methodparam>
  </methodsynopsis>
  <para>
   The <function>pcntl_sigwaitinfo</function> function suspends execution of the
   calling script until one of the signals given in <parameter>signals</parameter>
   are delivered. If one of the signal is already pending (e.g. blocked by
   <function>pcntl_sigprocmask</function>),
   <function>pcntl_sigwaitinfo</function> will return immediately.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>signals</parameter></term>
     <listitem>
      <para>
       Array of signals to wait for.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>info</parameter></term>
     <listitem>
      <para>
       The <parameter>info</parameter> parameter is set to an array containing
       information about the signal.
      </para>
      <para>
       The following elements are set for all signals:
       <simplelist>
        <member>signo: Signal number</member>
        <member>errno: An error number</member>
        <member>code: Signal code</member>
       </simplelist>
      </para>
      <para>
       The following elements may be set for the <constant>SIGCHLD</constant> signal:
       <simplelist>
        <member>status: Exit value or signal</member>
        <member>utime: User time consumed</member>
        <member>stime: System time consumed</member>
        <member>pid: Sending process ID</member>
        <member>uid: Real user ID of sending process</member>
       </simplelist>
      </para>
      <para>
       The following elements may be set for the <constant>SIGILL</constant>,
       <constant>SIGFPE</constant>, <constant>SIGSEGV</constant> and
       <constant>SIGBUS</constant> signals:
       <simplelist>
        <member>addr: Memory location which caused fault</member>
       </simplelist>
      </para>
      <para>
       The following element may be set for the <constant>SIGPOLL</constant>
       signal:
       <simplelist>
        <member>band: Band event</member>
        <member>fd: File descriptor number</member>
       </simplelist>
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns a signal number on success,&return.falseforfailure;.
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title><function>pcntl_sigwaitinfo</function> example</title>
    <programlisting role="php">
<![CDATA[
<?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);
?>
]]>
    </programlisting>
   </example>
  </para>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>pcntl_sigprocmask</function></member>
    <member><function>pcntl_sigtimedwait</function></member>
   </simplelist>
  </para>
 </refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
