php-doc-en/reference/pcntl/functions/pcntl-signal-get-handler.xml
Christoph Michael Becker ac51aaac3b Fix changelog entries
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@344866 c90b9560-bf6c-de11-be94-00142212c4b1
2018-04-27 15:08:50 +00:00

118 lines
3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.pcntl-signal-get-handler" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>pcntl_signal_get_handler</refname>
<refpurpose>Get the current handler for specified signal</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>pcntl_signal_get_handler</methodname>
<methodparam><type>int</type><parameter>signo</parameter></methodparam>
</methodsynopsis>
<para>
The <function>pcntl_signal_get_handler</function> function will get the current handler for the specified <parameter>signo</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>signo</parameter></term>
<listitem>
<para>
The signal number.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
This function may return an integer value that refers to <constant>SIG_DFL</constant> or <constant>SIG_IGN</constant>. If you set a custom handler a string value containing the function name is returned.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>7.1.0</entry>
<entry>
<function>pcntl_signal_get_handler</function> has been added.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1><!-- }}} -->
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>pcntl_signal_get_handler</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
var_dump(pcntl_signal_get_handler(SIGUSR1)); // Outputs: int(0)
function pcntl_test($signo) {}
pcntl_signal(SIGUSR1, 'pcntl_test');
var_dump(pcntl_signal_get_handler(SIGUSR1)); // Outputs: string(10) "pcntl_test"
pcntl_signal(SIGUSR1, SIG_DFL);
var_dump(pcntl_signal_get_handler(SIGUSR1)); // Outputs: int(0)
pcntl_signal(SIGUSR1, SIG_IGN);
var_dump(pcntl_signal_get_handler(SIGUSR1)); // Outputs: int(1)
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>pcntl_signal</function></member>
</simplelist>
</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
-->