Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/testsuite/winsup.api/sigchld.c')
-rw-r--r--winsup/testsuite/winsup.api/sigchld.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/winsup/testsuite/winsup.api/sigchld.c b/winsup/testsuite/winsup.api/sigchld.c
new file mode 100644
index 000000000..a7d1069b7
--- /dev/null
+++ b/winsup/testsuite/winsup.api/sigchld.c
@@ -0,0 +1,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 );
+}