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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [sim/] [testsuite/] [sim/] [cris/] [c/] [sig12.c] - Rev 842

Compare with Previous | Blame | View Log

/* Check that TRT happens for a signal sent to a non-existent process/thread, more than one thread.
#cc: additional_flags=-pthread
#notarget: cris*-*-elf
*/
 
#include <stdlib.h>
#include <stddef.h>
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
#include <sys/types.h>
#include <signal.h>
#include <errno.h>
 
static void *
process (void *arg)
{
  int i;
  for (i = 0; i < 100; i++)
    sched_yield ();
  return NULL;
}
 
int main (void)
{
  pthread_t th_a;
  int retcode;
  void *retval;
 
  if (pthread_create (&th_a, NULL, process, (void *) "a") != 0)
    abort ();
  if (kill (getpid () - 1, SIGBUS) != -1
      || errno != ESRCH
      || pthread_join (th_a, &retval) != 0)
    abort ();
  printf ("pass\n");
  exit (0);
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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