strace/test/clone.c
Mike Frysinger b51ce62454 test: include headers for used funcs
These funcs use things like wait/write/read/strcmp but sometimes
don't include the right header for them.

* test/Makefile: Add -Wall to CFLAGS.
* test/clone.c: Include unistd.h.
* test/fork.c: Include sys/wait.h.
* test/sig.c: Include unistd.h.
* test/sigkill_rain.c: Include sys/wait.h.
* test/vfork.c: Include sys/wait.h.
* test/wait_must_be_interruptible.c: Include string.h
2013-05-02 22:41:50 +00:00

22 lines
343 B
C

/* for CLONE_foo: */
#define _GNU_SOURCE 1
#include <stdio.h>
#include <stdlib.h>
#include <sched.h>
#include <unistd.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);
}