Wichert Akkerman | 529f06d | 2000-04-10 22:26:39 +0000 | [diff] [blame] | 1 | #include <stdio.h> |
Denys Vlasenko | 8ed5727 | 2009-02-25 14:24:02 +0000 | [diff] [blame] | 2 | #include <stdlib.h> |
Wichert Akkerman | 529f06d | 2000-04-10 22:26:39 +0000 | [diff] [blame] | 3 | #include <sched.h> |
4 | |||||
Denys Vlasenko | 8ed5727 | 2009-02-25 14:24:02 +0000 | [diff] [blame] | 5 | int child(void* arg) |
6 | { | ||||
7 | write(1, "clone\n", 6); | ||||
8 | return 0; | ||||
Wichert Akkerman | 529f06d | 2000-04-10 22:26:39 +0000 | [diff] [blame] | 9 | } |
10 | |||||
Denys Vlasenko | 8ed5727 | 2009-02-25 14:24:02 +0000 | [diff] [blame] | 11 | int main(int argc, char *argv[]) |
Wichert Akkerman | 529f06d | 2000-04-10 22:26:39 +0000 | [diff] [blame] | 12 | { |
Denys Vlasenko | 8ed5727 | 2009-02-25 14:24:02 +0000 | [diff] [blame] | 13 | char stack[4096]; |
Wichert Akkerman | 9b0c31d | 2000-09-03 21:56:29 +0000 | [diff] [blame] | 14 | clone(child, stack+4000, CLONE_VM|CLONE_FS|CLONE_FILES, NULL); |
15 | write(1, "original\n", 9); | ||||
Wichert Akkerman | 529f06d | 2000-04-10 22:26:39 +0000 | [diff] [blame] | 16 | exit(0); |
17 | } |