Qore Programming Language Reference Manual  0.8.13.5
 All Classes Namespaces Functions Variables Groups Pages
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
signalThe signal number to process, see Signal Constants for possible values
Example:
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
signalThe signal number to process, see Signal Constants for possible values
fThe code to execute when the signal is caught; this should accept an integer argument giving the signal number
Example:
1 set_signal_handler(SIGINT, \signal_handler());
See Also
Signal Handling for more information