philip Thu Jan 23 18:04:03 2003 EDT
Modified files:
/phpdoc/en/reference/pcntl/functions pcntl-signal.xml
Log:
Add new optional parameter information (restart_syscalls). Added information
on new ability to object method signal calls. Implemented &return.success;.
And added tick use to the example (required as of 4.3.0). This essentially
closes bug #20189.
Index: phpdoc/en/reference/pcntl/functions/pcntl-signal.xml
diff -u phpdoc/en/reference/pcntl/functions/pcntl-signal.xml:1.2
phpdoc/en/reference/pcntl/functions/pcntl-signal.xml:1.3
--- phpdoc/en/reference/pcntl/functions/pcntl-signal.xml:1.2 Wed Apr 17 02:42:45
2002
+++ phpdoc/en/reference/pcntl/functions/pcntl-signal.xml Thu Jan 23 18:04:02
+2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/pcntl.xml, last change in rev 1.2 -->
<refentry id="function.pcntl-signal">
<refnamediv>
@@ -12,6 +12,7 @@
<type>bool</type><methodname>pcntl_signal</methodname>
<methodparam><type>int</type><parameter>signo</parameter></methodparam>
<methodparam><type>mixed</type><parameter>handle</parameter></methodparam>
+ <methodparam
+choice="opt"><type>bool</type><parameter>restart_syscalls</parameter></methodparam>
</methodsynopsis>
<para>
The <function>pcntl_signal</function> function installs a new
@@ -19,17 +20,34 @@
<parameter>signo</parameter>. The signal handler is set to
<parameter>handler</parameter> which may be the name of a user
created function, or either of the two global constants SIG_IGN
- or SIG_DFL.
+ or SIG_DFL. The optional <parameter>restart_syscalls</parameter>
+ specifies whether system call restarting should be used when this
+ signal arrives and defaults to &true;.
</para>
<para>
- <function>pcntl_signal</function> returns &true; on success or
- &false; on failure.
+ &return.success;
</para>
+ <note>
+ <para>
+ The optional <parameter>restart_syscalls</parameter> parameter became
+ available in PHP 4.3.0.
+ </para>
+ </note>
+ <note>
+ <para>
+ The ability to use an object method as a callback became available in
+ PHP 4.3.0. Note that when you set a handler to an object method, that
+ object's reference count is increased which makes it persist until you
+ either change the handler to something else, or your script ends.
+ </para>
+ </note>
<example>
<title><function>pcntl_signal</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php
+// tick use required as of PHP 4.3.0
+declare (ticks = 1);
// signal handler function
function sig_handler($signo) {
@@ -55,8 +73,11 @@
// setup signal handlers
pcntl_signal(SIGTERM, "sig_handler");
-pcntl_signal(SIGHUP, "sig_handler");
+pcntl_signal(SIGHUP, "sig_handler");
pcntl_signal(SIGUSR1, "sig_handler");
+
+// or use an object, available as of PHP 4.3.0
+// pcntl_signal(SIGUSR1, array($obj, "do_something");
print "Generating signal SIGTERM to self...\n";
--
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php