Condition occurs with signal handler present

Figure 1 contains a simple example of a C application in which y = a/b is a mathematical operation. signal (SIGFPE, c_handler) is a signal invocation that registers the routine c_handler() and gives it control if a floating-point divide exception occurs.

Figure 1. C condition handling example
/*Module/File Name:  EDCCSIG  */
/**********************************************************************/
/* A routine with a C/370 condition handler registered.               */
/**********************************************************************/

#include <stdio.h>
#include <signal.h>

#ifdef __cplusplus
extern "C" {
#endif
   void c_handler(int);
#ifdef __cplusplus
}
#endif
int main(void) {
  int a=8, b=0, y;
  /* .
     .
     . */
  signal (SIGFPE, c_handler);
  /* .
     .
     . */
  y = a/b;
  /* .
     . */
}

void c_handler(int i)
{
   printf("handled SIGFPE\n");
  /* .
     . */
   return;
}
If b = 0, a floating-point divide condition occurs. Language Environment condition handling begins: If none of the above takes place, the condition manager gives the C signal-handler control. This handler in turn invokes c_handler() as specified in the signal() function in Figure 1. Control is then returned to the instruction following the one that caused the condition.