[ Event Handling | Reference Manual | Alphabetic Index ]

get_interrupt_handler(+IntId, -PredSpec, -Module)

Succeeds if PredSpec unifies with the specification of the current handler for interrupt IntId and Module unifies with its home module.
IntId
Integer or atom.
PredSpec
Term which unifies with atom/integer.
Module
Atom or variable.

Description

Provided IntId is a valid interrupt identifier, unifies PredSpec with the specification (i.e. a term of the form name/arity) of the current handler for interrupt IntId, and Module with the module in which it is defined.

The interrupts which exist are machine dependent. The interrupts which can be caught or trapped are implementation defined.

Modes and Determinism

Fail Conditions

Fails if no handler has been set for the interrupt IntId

Exceptions

(4) instantiation fault
IntId is not instantiated.
(5) type error
IntId is not an atom or integer.
(5) type error
PredSpec does not unify with atom/integer.
(6) out of range
IntId is not a valid interrupt name or number.

Examples

Success:
      ?- get_interrupt_handler(18,M,N).
      M = pause/0
      N = sepia_kernel
      yes.

      ?- set_interrupt_handler(18,true/0), kill(0, 18),
      > get_interrupt_handler(18,true/0,sepia_kernel).
      yes.
Fail:
      get_interrupt_handler(16, true/0, sepia_kernel).
Error:
      get_interrupt_handler(N,true/0,sepia_kernel).   (Error 4).
      get_interrupt_handler(5.0,true/0,sepia_kernel). (Error 5).
      get_interrupt_handler(-1,X,sepia_kernel).       (Error 6).

See Also

current_interrupt / 2, set_interrupt_handler / 2, kill / 2