summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.threads/killed.c
blob: 6cb3928a3466e13e526f0b3f9a3a138b743a5003 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <sys/types.h>
#include <signal.h>
#include <pthread.h>
#include <stdio.h>

int pid;

void *
child_func (void *dummy)
{
  kill (pid, SIGKILL);
  exit (1);
}

int
main ()
{
  pthread_t child;

  pid = getpid ();
  pthread_create (&child, 0, child_func, 0);
  for (;;)
    sleep (10000);
}