Denys Vlasenko | 8ed5727 | 2009-02-25 14:24:02 +0000 | [diff] [blame^] | 1 | #include <stdlib.h> |
2 | #include <unistd.h> | ||||
3 | |||||
4 | int main(int argc, char *argv[]) | ||||
Wichert Akkerman | faf7222 | 2000-02-19 23:59:03 +0000 | [diff] [blame] | 5 | { |
Denys Vlasenko | 8ed5727 | 2009-02-25 14:24:02 +0000 | [diff] [blame^] | 6 | if (vfork() == 0) { |
Wichert Akkerman | faf7222 | 2000-02-19 23:59:03 +0000 | [diff] [blame] | 7 | write(1, "child\n", 6); |
Denys Vlasenko | 8ed5727 | 2009-02-25 14:24:02 +0000 | [diff] [blame^] | 8 | } else { |
Wichert Akkerman | faf7222 | 2000-02-19 23:59:03 +0000 | [diff] [blame] | 9 | wait(0); |
10 | write(1, "parent\n", 7); | ||||
11 | } | ||||
Denys Vlasenko | 8ed5727 | 2009-02-25 14:24:02 +0000 | [diff] [blame^] | 12 | |
Wichert Akkerman | faf7222 | 2000-02-19 23:59:03 +0000 | [diff] [blame] | 13 | exit(0); |
14 | } |