strace/test/clone.c
Denys Vlasenko 8ed5727642 By Hans-Christian Egtvedt (hans-christian.egtvedt AT atmel.com):
strace.c: suppress "warning: unused static" message by adding #ifdef's around
 a variable
.gitignore: trivial
test/*.c: cleanup (suppress warnings, much better style).
2009-02-25 14:24:02 +00:00

18 lines
279 B
C

#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);
}