SIGNAL — Signal handling subroutine (or function)#
-
SIGNAL(NUMBER, HANDLER, STATUS)#
SIGNAL(NUMBER, HANDLER [, STATUS])
causes external subroutineHANDLER
to be executed with a single integer argument when signalNUMBER
occurs. IfHANDLER
is an integer, it can be used to turn off handling of signalNUMBER
or revert to its default action. Seesignal(2)
.- Parameters:
NUMBER – Shall be a scalar integer, with
INTENT(IN)
HANDLER – Signal handler (
INTEGER FUNCTION
orSUBROUTINE
) or dummy/globalINTEGER
scalar.INTEGER
. It isINTENT(IN)
.STATUS – (Optional)
STATUS
shall be a scalar integer. It hasINTENT(OUT)
.
- Returns:
The
SIGNAL
function returns the value returned bysignal(2)
.
- Standard:
GNU extension
- Class:
Subroutine, function
- Syntax:
CALL SIGNAL(NUMBER, HANDLER [, STATUS]) STATUS = SIGNAL(NUMBER, HANDLER)
- Example:
program test_signal intrinsic signal external handler_print call signal (12, handler_print) call signal (10, 1) call sleep (30) end program test_signal