Installing a signal handler

The following describes how to install a signal handler to handle SIGINT (signal 3, or Ctrl-C) interrupts.

The following installs the signal handler:

struct sigaction sigAction;sigAction.sa_handler = sigIntHandler;sigaction( SIGINT,&sigAction, NULL );

The following is the actual handler code itself. For the FAST Feed Handler, the handler simply sets the global active flag to false. Other programs which need to use similar code may choose to signal or broadcast to a mutex.

static void sigIntHandler( int signum ) {	active = false;}