blob: 1425e2dd3e3d457ebfff61fe4c9cc1af3ece7cf9 [file] [log] [blame]
Denys Vlasenko8ed57272009-02-25 14:24:02 +00001#include <stdlib.h>
2#include <unistd.h>
Mike Frysingerb51ce622013-05-02 15:43:45 -04003#include <sys/wait.h>
Denys Vlasenko8ed57272009-02-25 14:24:02 +00004
5int main(int argc, char *argv[])
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00006{
Denys Vlasenko8ed57272009-02-25 14:24:02 +00007 if (fork() == 0) {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00008 write(1, "child\n", 6);
Denys Vlasenko8ed57272009-02-25 14:24:02 +00009 } else {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000010 wait(0);
11 write(1, "parent\n", 7);
12 }
Denys Vlasenko8ed57272009-02-25 14:24:02 +000013
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000014 exit(0);
15}