Logo Search packages:      
Sourcecode: mingw-w64 version File versions  Download package

t_sigv.c
#include <stdio.h>
#include <setjmp.h>
#include <signal.h>

jmp_buf buf;

void catchSigSegV( int sig )
{
 longjmp(buf, 1);
}

int *ptr = 0;

int main(void)
{
 volatile int v;
 signal(SIGSEGV, catchSigSegV);
 if (!setjmp(buf))
 {
  puts("Ready to catch");
  v = *ptr;
  puts("Bad");
 }
  else puts("Ok");
 return 0;
}

Generated by  Doxygen 1.6.0   Back to index