Exemplo n.º 1
0
extern void
keeper (int sig)
{
  static int recurse = 0;
  if (++recurse < 3)
    bowler ();

  _exit (0);
}
Exemplo n.º 2
0
int
main (void)
{
  struct sigaction act;
  memset (&act, 0, sizeof act);
  act.sa_handler = keeper;
  act.sa_flags = SA_NODEFER;
  sigaction (SIGSEGV, &act, NULL);
  sigaction (SIGBUS, &act, NULL);

  bowler ();
  return 0;
}
Exemplo n.º 3
0
int
main ()
{
  static volatile int i;

  struct sigaction act;
  memset (&act, 0, sizeof act);
  act.sa_handler = keeper;
  sigaction (SIGSEGV, &act, NULL);
  sigaction (SIGBUS, &act, NULL);

  bowler ();
  return 0;
}
Exemplo n.º 4
0
int
main ()
{
  static volatile int i;

  struct sigaction act;
  memset (&act, 0, sizeof act);
  act.sa_handler = keeper;
  sigaction (SIGSEGV, &act, NULL);
  sigaction (SIGBUS, &act, NULL);

  for (i = 0; i < 10; i++)
    {
      sigsetjmp (env, 1);
      bowler ();
    }
}