strace/test/clone.c

22 lines
343 B
C
Raw Normal View History

/* for CLONE_foo: */
#define _GNU_SOURCE 1
2000-04-10 22:26:39 +00:00
#include <stdio.h>
#include <stdlib.h>
2000-04-10 22:26:39 +00:00
#include <sched.h>
#include <unistd.h>
2000-04-10 22:26:39 +00:00
int child(void *arg)
{
write(1, "clone\n", 6);
return 0;
2000-04-10 22:26:39 +00:00
}
int main(int argc, char *argv[])
2000-04-10 22:26:39 +00:00
{
char stack[4096];
clone(child, stack+4000, CLONE_VM|CLONE_FS|CLONE_FILES, NULL);
write(1, "original\n", 9);
2000-04-10 22:26:39 +00:00
exit(0);
}