blob: f49a47338aa8f873e87961a05a5bfd1eafd6b216 [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 Akkermanfaf72222000-02-19 23:59:03 +00006{
Denys Vlasenko8ed57272009-02-25 14:24:02 +00007 if (vfork() == 0) {
Wichert Akkermanfaf72222000-02-19 23:59:03 +00008 write(1, "child\n", 6);
Denys Vlasenko8ed57272009-02-25 14:24:02 +00009 } else {
Wichert Akkermanfaf72222000-02-19 23:59:03 +000010 wait(0);
11 write(1, "parent\n", 7);
12 }
Denys Vlasenko8ed57272009-02-25 14:24:02 +000013
Wichert Akkermanfaf72222000-02-19 23:59:03 +000014 exit(0);
15}