Julian Seward 7c542ccd39 Add new files resulting from merging in the 2.4.0 line. Many of these
seem to be simply duplication of the x86 instruction set tests into
the addrcheck and helgrind trees.  I'm not sure what this duplication
achieves.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3264
2005-03-10 23:23:45 +00:00

32 lines
596 B
C

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
static void handler(int sig, siginfo_t *info, void *v)
{
printf("info: sig=%d code=%d addr=%p\n",
info->si_signo, info->si_code, info->si_addr);
exit(0);
}
/* Blocking a fault, ie SIGSEGV, won't work, and is the same as having
the default handler */
int main()
{
struct sigaction sa;
sigset_t mask;
sa.sa_sigaction = handler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_SIGINFO;
sigaction(SIGSEGV, &sa, NULL);
sigfillset(&mask);
sigprocmask(SIG_BLOCK, &mask, NULL);
*(volatile int *)1234 = 213;
return 0;
}