mc_translate.c: enable further uses of DLexpensive for scalar EQ/NE comparisons
[valgrind.git] / none / tests / fork.c
blob22a7c211b743b34255ad26c99cf4569730f417ee
2 #include <unistd.h>
3 #include <sys/types.h>
4 #include <sys/wait.h>
5 #include <stdio.h>
7 int main(void)
9 pid_t pid;
11 pid = fork ();
13 /* Sometimes child goes first (non-zero), sometimes parent (zero). This
14 printing means we can detect if we correctly get a zero result and a
15 non-zero result (--> three 'X's printed), but the output doesn't depend
16 on the order. */
18 printf("%s", pid==0 ? "X" : "XX");
20 if (pid != 0)
21 waitpid(pid, NULL, 0);
23 return 0;