|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-04-14 22:31 UTC] sniper@php.net
[2004-04-21 00:12 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 18:00:02 2025 UTC |
Description: ------------ pcntl_waitpid with option WNOHANG | WUNTRACED behaves just like WNOHANG alone, that means it never returns PID of children that have exited before. This could be a bug in Linux too. Please excuse me if I just don't understand the way pcntl_waitpid should work. Here's my php config: ./configure --with-apxs --with-config-file-path=/usr/local/lib --with-zlib --enable-ftp --enable-calendar --enable-track-vars --with-pgsql --with-unixodbc --with-mysql --enable-sigchild --enable-pcntl --with-gd --enable-cli --with-snmp --enable-ucd-snmp-hack --with-openssl --enable-sockets --prefix=/usr/local/stow/php-4.3.4 --with-curl Reproduce code: --------------- function CheckExited () { while (($c=pcntl_waitpid(-1, $stat, WUNTRACED | WNOHANG))>0) { ExitTest($c,$stat); } } function ExitTest($c,$stat) { blabla..;} while ($condition) { . . . $CHILD_PID = pcntl_fork(); . . . CheckExited(); } Expected result: ---------------- pcntl_waitpid(...WNOHANG|WUNTRACED) should return PIDs of all children that have exited since the last call of CheckExited(). Actual result: -------------- pcntl_waitpid(...WNOHANG|WUNTRACED) doesn't return any PIDs