Lines Matching defs:signal

120         148 => 'Terminal stop signal',
245 * @throws ProcessSignaledException When process stopped after receiving signal
319 // exec is mandatory to deal with sending a signal to the process
412 * @throws ProcessSignaledException When process stopped after receiving signal
504 * Sends a POSIX signal to the process.
506 * @param int $signal A valid POSIX signal (see https://php.net/pcntl.constants)
514 public function signal(int $signal)
516 $this->doSignal($signal, true);
789 * Returns true if the child process has been terminated by an uncaught signal.
805 * Returns the number of the signal that caused the child process to terminate its execution.
819 throw new RuntimeException('This PHP has been compiled with --enable-sigchild. Term signal cannot be retrieved.');
826 * Returns true if the child process has been stopped by a signal.
842 * Returns the number of the signal that caused the child process to stop its execution.
913 * @param int $signal A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9)
917 public function stop(float $timeout = 10, int $signal = null)
930 $this->doSignal($signal ?: 9, false);
938 return $this->stop(0, $signal);
1489 * Sends a POSIX signal to the process.
1491 * @param int $signal A valid POSIX signal (see https://php.net/pcntl.constants)
1492 * @param bool $throwException Whether to throw exception in case signal failed
1498 private function doSignal(int $signal, bool $throwException): bool
1502 throw new LogicException('Cannot send signal on a non running process.');
1519 $ok = @proc_terminate($this->process, $signal);
1521 $ok = @posix_kill($pid, $signal);
1522 } elseif ($ok = proc_open(sprintf('kill -%d %d', $signal, $pid), [2 => ['pipe', 'w']], $pipes)) {
1527 throw new RuntimeException(sprintf('Error while sending signal "%s".', $signal));
1534 $this->latestSignal = $signal;