Home > PHP > Function > PCNTL > pcntl_signal()

pcntl_signal()

pcntl_signal - Installs a signal handler

Syntax

bool pcntl_signal (int $signo, callback $handler, bool $restart_syscalls)

Arguments

  • signo - The signal number.
  • handler - The signal handler which may be the name of a user created function, or method, or either of the two global constants SIG_IGN or SIG_DFL. Note: Note that when you set a handler to an object method, that object\'s reference count is increased which makes it persist until you either change the handler to something else, or your script ends.
  • restart_syscalls - Specifies whether system call restarting should be used when this signal arrives.

Description

The pcntl_signal() function installs a new signal handler for the signal indicated by signo.

Version

PHP 4.1.0, 5

Return value

Returns TRUE on success or FALSE on failure.