newlib-cygwin/winsup/testsuite/winsup.api/sigchld.c

23 lines
316 B
C
Raw Normal View History

2000-09-03 11:58:18 +08:00
#include <sys/types.h>
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
2000-09-03 11:58:18 +08:00
int no_signal_caught = 1;
void handler ( int signo )
{
no_signal_caught = 0;
}
int
2000-09-03 11:58:18 +08:00
main()
{
pid_t pid;
signal ( SIGCHLD, handler );
pid = fork();
if ( pid == 0 ) exit ( 0 );
sleep ( 2 );
exit ( no_signal_caught );
}