mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-05 11:10:21 +00:00
child run; this was random so the test was failing spuriously sometimes. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1123
21 lines
414 B
C
21 lines
414 B
C
|
|
#include <unistd.h>
|
|
#include <sys/types.h>
|
|
#include <stdio.h>
|
|
|
|
int main(void)
|
|
{
|
|
pid_t pid;
|
|
|
|
pid = fork ();
|
|
|
|
/* Sometimes child goes first (non-zero), sometimes parent (zero). This
|
|
printing means we can detect if we correctly get a zero result and a
|
|
non-zero result (--> three 'X's printed), but the output doesn't depend
|
|
on the order. */
|
|
|
|
printf("%s", pid==0 ? "X" : "XX");
|
|
|
|
return 0;
|
|
}
|