use POSIX ":sys_wait_h"; ... if(waitpid($pid_c, WNOHANG)){ ... }