SIGNAL(I, PROC) (IBM extension)

Purpose

The SIGNAL procedure allows a program to specify a procedure to be invoked upon receipt of a specific operating-system signal.

Class

Subroutine

Argument type and attributes

I
is an integer that specifies the value of the signal to be acted upon. It is an INTENT(IN) argument. Available signal values are defined in the C include file signal.h; a subset of signal values is defined in the Fortran include file fexcp.h.
PROC
specifies the user-defined procedure to be invoked when the process receives the specified signal specified by argument I. It is an INTENT(IN) argument.

Examples

      INCLUDE 'fexcp.h'
      INTEGER   SIGUSR1
      EXTERNAL  USRINT
! Set exception handler to produce the traceback code.
! The SIGTRAP is defined in the include file fexcp.h.
! xl__trce is a procedure in the XL Fortran
! run-time library.  It generates the traceback code.
      CALL SIGNAL(SIGTRAP, XL__TRCE)
      …
! Use user-defined procedure USRINT to handle the signal
! SIGUSR1.
      CALL SIGNAL(SIGUSR1, USRINT)
      …

Related information

The -qsigtrap option in the XL Fortran Compiler Reference allows you to set a handler for SIGTRAP signals through a compiler option.