Unix signals

On Unix the Modula-3 runtime catches seven signals: SIGHUP, SIGINT, SIGTERM, SIGQUIT, SIGSEGV, SIGPIPE, and SIGVTALRM. Otherwise, the runtime leaves the default Unix signal handlers unaltered.

SIGHUP(``hang up''), SIGINT(``interrupt''), and SIGTERM(``terminate'') all indicate that the program is to stop. The Modula-3 runtime calls its usual clean-up routines and exits.

SIGQUIT is like the above, except the runtime prints the error message ``aborted'', and attempts to crash with a ``core file''.

SIGSEGV indicates a ``segmentation violation'' and is often signaled when a process dereferences NIL. The runtime catches SIGSEGV, prints an error message, and attempts to crash with a ``core file''.

SIGPIPE indicates a ``broken pipe''. The runtime ignores the signal and when next accessed, any reader(writer) that was using the pipe will raise Rd.Failure(Wr.Failure).

SIGVTALRM is the ``virtual timer alarm''. It is used to periodically preempt the running thread.