summaryrefslogtreecommitdiffstats
path: root/winsup/testsuite/winsup.api/sigchld.c
blob: a7d1069b734bc62b067bd12b7004b1b5c920aaf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <sys/types.h>
#include <unistd.h>
#include <signal.h>

int no_signal_caught = 1;

void handler ( int signo )
{
  no_signal_caught = 0;
}

main()
{
  pid_t pid;
  signal ( SIGCHLD, handler );
  pid = fork();
  if ( pid == 0 ) exit ( 0 );
  sleep ( 2 );
  exit ( no_signal_caught );
}