add missing tests/basic and tests/fork
[ust.git] / tests / fork / fork.c
diff --git a/tests/fork/fork.c b/tests/fork/fork.c
new file mode 100644 (file)
index 0000000..20a0877
--- /dev/null
@@ -0,0 +1,31 @@
+#include <stdio.h>
+#include <unistd.h>
+
+#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;
This page took 0.023357 seconds and 4 git commands to generate.