X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ffork%2Ffork.c;fp=tests%2Ffork%2Ffork.c;h=20a08779f367cc413d2da769c0b25853797f90ec;hb=48c56fcfaec23b51b49cbafb745b1638f8594068;hp=0000000000000000000000000000000000000000;hpb=b13ba58434cd56230598d262b976ac787f0943d1;p=ust.git diff --git a/tests/fork/fork.c b/tests/fork/fork.c new file mode 100644 index 0000000..20a0877 --- /dev/null +++ b/tests/fork/fork.c @@ -0,0 +1,31 @@ +#include +#include + +#include "marker.h" + + +int main() +{ + int result; + + printf("Fork test program\n"); + trace_mark(ust, before_fork, MARK_NOARGS); + + sleep(5); + + result = fork(); + if(result == -1) { + perror("fork"); + return 1; + } + if(result == 0) { + trace_mark(ust, after_fork_child, MARK_NOARGS); + } + else { + trace_mark(ust, after_fork_parent, MARK_NOARGS); + } + + return 0; +} + +MARKER_LIB;