URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 24 |
Rev 157 |
/* Check that TRT happens for a signal sent to a non-existent process/thread, more than one thread.
|
/* Check that TRT happens for a signal sent to a non-existent process/thread, more than one thread.
|
#cc: additional_flags=-pthread
|
#cc: additional_flags=-pthread
|
#notarget: cris*-*-elf
|
#notarget: cris*-*-elf
|
*/
|
*/
|
|
|
#include <stdlib.h>
|
#include <stdlib.h>
|
#include <stddef.h>
|
#include <stddef.h>
|
#include <stdio.h>
|
#include <stdio.h>
|
#include <unistd.h>
|
#include <unistd.h>
|
#include <pthread.h>
|
#include <pthread.h>
|
#include <sys/types.h>
|
#include <sys/types.h>
|
#include <signal.h>
|
#include <signal.h>
|
#include <errno.h>
|
#include <errno.h>
|
|
|
static void *
|
static void *
|
process (void *arg)
|
process (void *arg)
|
{
|
{
|
int i;
|
int i;
|
for (i = 0; i < 100; i++)
|
for (i = 0; i < 100; i++)
|
sched_yield ();
|
sched_yield ();
|
return NULL;
|
return NULL;
|
}
|
}
|
|
|
int main (void)
|
int main (void)
|
{
|
{
|
pthread_t th_a;
|
pthread_t th_a;
|
int retcode;
|
int retcode;
|
void *retval;
|
void *retval;
|
|
|
if (pthread_create (&th_a, NULL, process, (void *) "a") != 0)
|
if (pthread_create (&th_a, NULL, process, (void *) "a") != 0)
|
abort ();
|
abort ();
|
if (kill (getpid () - 1, SIGBUS) != -1
|
if (kill (getpid () - 1, SIGBUS) != -1
|
|| errno != ESRCH
|
|| errno != ESRCH
|
|| pthread_join (th_a, &retval) != 0)
|
|| pthread_join (th_a, &retval) != 0)
|
abort ();
|
abort ();
|
printf ("pass\n");
|
printf ("pass\n");
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.