src/Ko/ProcessManager.php
protected function internalFork(Process $p)
    {
        $p->setReady(false);

        $pid = pcntl_fork();
        if (-1 === $pid) {
            throw new \RuntimeException('Failure on pcntl_fork');
        }

        if ($pid) {
            $this->children[$pid] = $p;

            return $p->setPid($pid)
                ->waitReady();
        }

        $p->setPid(getmypid())
            ->run();

        exit(0);
    }
protected function internalFork(Process $p)
    {
        $p->setReady(false);

        $pid = pcntl_fork();
        if (-1 === $pid) {
            throw new \RuntimeException('Failure on pcntl_fork');
        }

        if ($pid) {
            $this->children[$pid] = $p;

            return $p->setPid($pid)
                ->waitReady();
        }

        $p->setPid(getmypid())
            ->run();

        exit(0);
    }
@param Process $p

@return Process