blob: 5de302f8eabdd74bec00f87aaa44626f2412a69b [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>
7
Denys Vlasenko8ed57272009-02-25 14:24:02 +00008int child(void* arg)
9{
10 write(1, "clone\n", 6);
11 return 0;
Wichert Akkerman529f06d2000-04-10 22:26:39 +000012}
13
Denys Vlasenko8ed57272009-02-25 14:24:02 +000014int main(int argc, char *argv[])
Wichert Akkerman529f06d2000-04-10 22:26:39 +000015{
Denys Vlasenko8ed57272009-02-25 14:24:02 +000016 char stack[4096];
Wichert Akkerman9b0c31d2000-09-03 21:56:29 +000017 clone(child, stack+4000, CLONE_VM|CLONE_FS|CLONE_FILES, NULL);
18 write(1, "original\n", 9);
Wichert Akkerman529f06d2000-04-10 22:26:39 +000019 exit(0);
20}