• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* for CLONE_foo: */
2 #define _GNU_SOURCE 1
3 
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <sched.h>
7 #include <unistd.h>
8 
child(void * arg)9 int child(void* arg)
10 {
11 	write(1, "clone\n", 6);
12 	return 0;
13 }
14 
main(int argc,char * argv[])15 int main(int argc, char *argv[])
16 {
17 	char stack[4096];
18 	clone(child, stack+4000, CLONE_VM|CLONE_FS|CLONE_FILES, NULL);
19 	write(1, "original\n", 9);
20 	exit(0);
21 }
22