note 99480 added to function.pcntl-fork

From: Date: Thu, 19 Aug 2010 12:00:49 +0000
Subject: note 99480 added to function.pcntl-fork
Groups: php.notes 
Request: Send a blank email to php-notes+get-171845@lists.php.net to get a copy of this message
PLEASE DELETE MY PREVIOUS COMMENT As suggested by some guy who's comment was for some reason deleted, lines <?php //Kill parent process now (self) to prevent zombie creation. posix_kill(posix_getpid(), SIGTERM); ?> Can be replaced with: <?php pcntl_signal(SIGCHLD, SIG_IGN); ?> But latter can be platform-dependent (see http://en.wikipedia.org/wiki/SIGCHLD) and also it can lead to the unexpected behavior in shell_exec, proc_open functions if you do not reinstall SIGCHLD handler, because they handle SIGCHLD signal, so i advise to use former solution. Personally i tested this solution on Linux 2.6.34-12 and FreeBSD 8.0 and it works perfectly. ---- Server IP: 69.147.83.197 Probable Submitter: 77.68.106.226 ---- Manual Page -- http://www.php.net/manual/en/function.pcntl-fork.php Edit -- https://master.php.net/note/edit/99480 Del: integrated -- https://master.php.net/note/delete/99480/integrated Del: useless -- https://master.php.net/note/delete/99480/useless Del: bad code -- https://master.php.net/note/delete/99480/bad+code Del: spam -- https://master.php.net/note/delete/99480/spam Del: non-english -- https://master.php.net/note/delete/99480/non-english Del: in docs -- https://master.php.net/note/delete/99480/in+docs Del: other reasons-- https://master.php.net/note/delete/99480 Reject -- https://master.php.net/note/reject/99480 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#171845) next »