strace/test/fork.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

15 lines
186 B
C

#include <stdlib.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
if (fork() == 0) {
write(1, "child\n", 6);
} else {
wait(0);
write(1, "parent\n", 7);
}
exit(0);
}