Simple trap handler example.

The trap example illustrates how to define a trap handler (swi handler) and how to invoke the handler. The trap handlers are defined by using the GNU extension __attribute__.

trap.h
Definition of trap handlers.

trap.c
Implementation of the trap handlers.

trap-main.c
Main that installs and invokes the trap handlers.

Source file: trap-main.c Source file: trap.c