OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gdb/] [gdb-6.8/] [sim/] [testsuite/] [sim/] [cris/] [c/] [sig12.c] - Blame information for rev 26

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 26 jlechner
/* Check that TRT happens for a signal sent to a non-existent process/thread, more than one thread.
2
#cc: additional_flags=-pthread
3
#notarget: cris*-*-elf
4
*/
5
 
6
#include <stdlib.h>
7
#include <stddef.h>
8
#include <stdio.h>
9
#include <unistd.h>
10
#include <pthread.h>
11
#include <sys/types.h>
12
#include <signal.h>
13
#include <errno.h>
14
 
15
static void *
16
process (void *arg)
17
{
18
  int i;
19
  for (i = 0; i < 100; i++)
20
    sched_yield ();
21
  return NULL;
22
}
23
 
24
int main (void)
25
{
26
  pthread_t th_a;
27
  int retcode;
28
  void *retval;
29
 
30
  if (pthread_create (&th_a, NULL, process, (void *) "a") != 0)
31
    abort ();
32
  if (kill (getpid () - 1, SIGBUS) != -1
33
      || errno != ESRCH
34
      || pthread_join (th_a, &retval) != 0)
35
    abort ();
36
  printf ("pass\n");
37
  exit (0);
38
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.