#23647 [Opn->Csd]: pcntl_fork() reruns forked script
ID: 23647
Updated by: sniper@php.net
Reported By: polone at townnews dot com
-Status: Open
+Status: Closed
-Bug Type: Unknown/Other Function
+Bug Type: *Extensibility Functions
Operating System: Linux
PHP Version: 4.3.1
New Comment:
Seems to be fixed in CVS. (verify by trying the latest stable
snapshot from http://snaps.php.net)
Previous Comments:
------------------------------------------------------------------------
[2003-05-15 16:31:33] polone at townnews dot com
The following script:
<?php
echo "Hello!";
if (pcntl_fork()) {
exit;
}
?>
Should produce only one "Hello!". The problem is that it appears to
restart execution of the script, causing the text "Hello!" to appear
twice.
This is _NOT_ how fork() works. The process should continue executing
from where the pcntl_fork() function call was issued, and exit the
parent process.
Is this related to SA_RESTART and changes made to restart signal
handlers in PHP 4.3.0?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23647&edit=1
Thread (3 messages)