| Extracted from Pike v7.8 release 866 at 2018-07-18.

[Top]

# Method signal()

Method signal

  `void signal(int sig, function(int|void:void) callback)`
  `void signal(int sig)`

Description

  Trap signals.

  This function allows you to trap a signal and have a function called when the process receives a signal. Although it IS possible to trap SIGBUS, SIGSEGV etc. I advice you not to. Pike should not receive any such signals and if it does it is because of bugs in the Pike interpreter. And all bugs should be reported, no matter how trifle.

  The callback will receive the signal number as its only argument.

  See the documentation for kill() for a list of signals.

  If no second argument is given, the signal handler for that signal is restored to the default handler.

  If the second argument is zero, the signal will be completely ignored.

See also

  kill() , signame() , signum()