summaryrefslogtreecommitdiff
path: root/test/clone.c
blob: 335086fcb70723dd53cc1fc4f99b5147ed16061a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
#include <stdlib.h>
#include <sched.h>

int child(void* arg)
{
	write(1, "clone\n", 6);
	return 0;
}

int main(int argc, char *argv[])
{
	char stack[4096];
	clone(child, stack+4000, CLONE_VM|CLONE_FS|CLONE_FILES, NULL);
	write(1, "original\n", 9);
	exit(0);
}