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__.
swi
__attribute__
Source file: trap-main.c Source file: trap.c