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 | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 5 | { |
Denys Vlasenko | 8ed5727 | 2009-02-25 14:24:02 +0000 | [diff] [blame] | 6 | if (fork() == 0) { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +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 | 76baf7c | 1999-02-19 00:21:36 +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 | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 13 | exit(0); |
14 | } |