summaryrefslogtreecommitdiffstats
path: root/winsup/testsuite/winsup.api/waitpid.c
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-09-03 03:58:18 +0000
committerChristopher Faylor <me@cgf.cx>2000-09-03 03:58:18 +0000
commitf1930aec47835e0ce231dff1893826824a462567 (patch)
tree1f55fcc9c63b707adc8ea3d767ebd7510904f148 /winsup/testsuite/winsup.api/waitpid.c
parent42f03f675735b0ab55f86824894706e39878b5cc (diff)
downloadcygnal-f1930aec47835e0ce231dff1893826824a462567.tar.gz
cygnal-f1930aec47835e0ce231dff1893826824a462567.tar.bz2
cygnal-f1930aec47835e0ce231dff1893826824a462567.zip
Importing Egor's testsuite.
Diffstat (limited to 'winsup/testsuite/winsup.api/waitpid.c')
-rw-r--r--winsup/testsuite/winsup.api/waitpid.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/winsup/testsuite/winsup.api/waitpid.c b/winsup/testsuite/winsup.api/waitpid.c
new file mode 100644
index 000000000..9845cd1a4
--- /dev/null
+++ b/winsup/testsuite/winsup.api/waitpid.c
@@ -0,0 +1,22 @@
+#include <stdio.h>
+#include <sys/wait.h>
+#include <errno.h>
+
+int
+main (int argc, char **argv)
+{
+ int pid, n;
+ if ((pid = fork ()) == 0)
+ exit (0);
+ sleep (2);
+ if ((n = waitpid (pid, NULL, 0)) != pid)
+ {
+ printf ("wait pid failed, pid %d, n %d, errno %d\n", pid, n, errno);
+ exit(1);
+ }
+ else
+ {
+ printf ("wait pid succeeded, pid %d, n %d, errno %d\n", pid, n, errno);
+ exit (0);
+ }
+}