Qore Programming Language Reference Manual: Signal Handing Functions

Qore Programming Language Reference Manual 0.8.11

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

All Classes Namespaces Functions Variables Groups Pages
Functions
Signal Handing Functions

## Functions
nothing | Qore::remove_signal_handler (softint signal)
| Removes a signal handler and returns the signal handling state to the default. More...
nothing | Qore::set_signal_handler (softint signal, code f)
| Sets or replaces a signal handler according to the signal number and closure or call reference (function or object method reference) passed. More...

## Detailed Description

Signal handing functions

## Function Documentation

nothing Qore::remove_signal_handler | ( | softint | signal | ) |

Removes a signal handler and returns the signal handling state to the default.

Platform Availability:
  Qore::Option::HAVE_SIGNAL_HANDLING

Restrictions:
  Qore::PO_NO_PROCESS_CONTROL

By the time this function returns, changes to the signal handling thread have already been effected.

Parameters

  signal | The signal number to process, see Signal Constants for possible values

Example:
  remove_signal_handler(SIGINT);

See Also
  Signal Handling for more information

nothing Qore::set_signal_handler | ( | softint | signal,
|  | code | f
| ) |  |

Sets or replaces a signal handler according to the signal number and closure or call reference (function or object method reference) passed.

Platform Availability:
  Qore::Option::HAVE_SIGNAL_HANDLING

Restrictions:
  Qore::PO_NO_PROCESS_CONTROL

By the time this function returns, changes to the signal handling thread have already been effected.

When a signal is raised and the signal handler code is called, the signal number is passed as an integer argument to the signal handling code.

Parameters

  signal | The signal number to process, see Signal Constants for possible values
  f | The code to execute when the signal is caught; this should accept an integer argument giving the signal number

Example:
  set_signal_handler(SIGINT, \signal_handler());

See Also
  Signal Handling for more information