9b978ffe8b
* winsup.api/checksignal.c: Ditto. * winsup.api/crlf.c: Ditto. * winsup.api/devzero.c: Ditto. * winsup.api/iospeed.c: Ditto. * winsup.api/mmaptest01.c: Ditto. * winsup.api/mmaptest02.c: Ditto. * winsup.api/mmaptest03.c: Ditto. * winsup.api/mmaptest04.c: Ditto. * winsup.api/nullgetcwd.c: Ditto. * winsup.api/sigchld.c: Ditto. * winsup.api/signal-into-win32-api.c: Ditto. * winsup.api/systemcall.c: Ditto. * winsup.api/waitpid.c: Ditto. * winsup.api/pthread/mainthreadexits.c: Ditto. * winsup.api/pthread/test.h: Ditto. * winsup.api/pthread/threadidafterfork.c: Ditto. * Makefile.in: Remove cygrun.exe from RUNTIME since it is built here now.
25 lines
465 B
C
25 lines
465 B
C
#include <stdio.h>
|
|
#include <sys/wait.h>
|
|
#include <errno.h>
|
|
#include <unistd.h>
|
|
#include <stdlib.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);
|
|
}
|
|
}
|