blob: bdce8b19b65fd8df697bd2061764acf91d3bf3f1 [file] [log] [blame]
Denys Vlasenko8158e772011-06-08 14:08:59 +02001/* for CLONE_foo: */
2#define _GNU_SOURCE 1
3
Wichert Akkerman529f06d2000-04-10 22:26:39 +00004#include <stdio.h>
Denys Vlasenko8ed57272009-02-25 14:24:02 +00005#include <stdlib.h>
Wichert Akkerman529f06d2000-04-10 22:26:39 +00006#include <sched.h>
Mike Frysingerb51ce622013-05-02 15:43:45 -04007#include <unistd.h>
Wichert Akkerman529f06d2000-04-10 22:26:39 +00008
Denys Vlasenko8ed57272009-02-25 14:24:02 +00009int child(void* arg)
10{
11 write(1, "clone\n", 6);
12 return 0;
Wichert Akkerman529f06d2000-04-10 22:26:39 +000013}
14
Denys Vlasenko8ed57272009-02-25 14:24:02 +000015int main(int argc, char *argv[])
Wichert Akkerman529f06d2000-04-10 22:26:39 +000016{
Denys Vlasenko8ed57272009-02-25 14:24:02 +000017 char stack[4096];
Wichert Akkerman9b0c31d2000-09-03 21:56:29 +000018 clone(child, stack+4000, CLONE_VM|CLONE_FS|CLONE_FILES, NULL);
19 write(1, "original\n", 9);
Wichert Akkerman529f06d2000-04-10 22:26:39 +000020 exit(0);
21}