Qore Programming Language Reference Manual  0.9.2
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

◆ remove_signal_handler()

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

◆ set_signal_handler()

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:
set_signal_handler(SIGINT, \signal_handler());
See also
Signal Handling for more information