[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

25 Interrupt Handling

When FreeM receives the SIGINT signal, either by pressing Ctrl-C during program execution, or by external signal from the operating system, the FreeM daemon, or another external process, one of two things can happen, depending on the state of the $ZI special variable:

$ZI evaluates true

In this case, the ZINRPT error is raised, and normal error handling procedures apply. If neither $ZTRAP nor $ETRAP are set, FreeM prints an error diagnostic on the home device and will exit the FreeM process in application mode (i.e., the freem executable was started with the --routine or -r flag), or return to the direct mode prompt otherwise.

This is the default behavior of FreeM.

$ZI evaluates false

In this case, no error is raised, but the $ZCONTROLC flag is set. In this mode of operation, it is up to program code to check for $ZCONTROLC and take appropriate action.

Checking the value of $ZCONTROLC will reset it to false.

In either case, if asynchronous event handling is enabled for the INTERRUPT event class (i.e., ASTART "INTERRUPT" or ASTART have been invoked by the current process), an asynchronous event of event class INTERRUPT and event identifier SIGINT will be enqueued.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on November 11, 2022 using texi2html 5.0.