* sim/cris: New directory with C and assembly tests for the CRIS
[deliverable/binutils-gdb.git] / sim / testsuite / sim / cris / c / rtsigprocmask1.c
1 /* Compiler options:
2 #notarget: cris*-*-elf
3 #cc: additional_flags=-pthread
4 #xerror:
5 #output: Unimplemented rt_sigprocmask syscall (0x3, 0x0, 0x3dff*\n
6 #output: program stopped with signal 4.\n
7
8 Testing a signal handler corner case. */
9
10 #include <stddef.h>
11 #include <stdlib.h>
12 #include <stdio.h>
13 #include <unistd.h>
14 #include <signal.h>
15 #include <pthread.h>
16
17 static void *
18 process (void *arg)
19 {
20 while (1)
21 sched_yield ();
22 return NULL;
23 }
24
25 int
26 main (void)
27 {
28 int retcode;
29 pthread_t th_a;
30 void *retval;
31 sigset_t sigs;
32
33 if (sigemptyset (&sigs) != 0)
34 abort ();
35
36 retcode = pthread_create (&th_a, NULL, process, NULL);
37 if (retcode != 0)
38 abort ();
39
40 /* An invalid parameter 1 should cause this to halt the simulator. */
41 pthread_sigmask (SIG_BLOCK + SIG_UNBLOCK + SIG_SETMASK,
42 NULL, &sigs);
43 printf ("xyzzy\n");
44 return 0;
45 }
This page took 0.038308 seconds and 4 git commands to generate.