xref: /netbsd-src/external/gpl3/gdb/dist/sim/testsuite/cris/c/sig2.c (revision b2c35e17b976cf7ccd7250c86c6f5e95090ed636)
1 /*
2 #progos: linux
3 */
4 
5 #include <stdio.h>
6 #include <signal.h>
7 #include <stdlib.h>
8 
9 /* Like sig1.c, but using sigaction.  */
10 
11 void
12 leave (int n, siginfo_t *info, void *x)
13 {
14   abort ();
15 }
16 
17 int
18 main (void)
19 {
20   struct sigaction sa;
21   sa.sa_sigaction = leave;
22   sa.sa_flags = SA_RESTART | SA_SIGINFO;
23   sigemptyset (&sa.sa_mask);
24 
25   /* Check that the sigaction syscall (for signal) is interpreted, though
26      possibly ignored.  */
27   if (sigaction (SIGFPE, &sa, NULL) != 0)
28     abort ();
29 
30   printf ("pass\n");
31   exit (0);
32 }
33