blob: 8995beb5655d1cd4e34de0885d203b09c0fe1719 [file] [log] [blame]
njn25e49d8e72002-09-23 09:36:25 +00001
2#include <unistd.h>
3#include <sys/types.h>
4#include <stdio.h>
5
6int main(void)
7{
8 pid_t pid;
9
10 pid = fork ();
11
njn91980082002-09-27 10:38:20 +000012 /* Sometimes child goes first (non-zero), sometimes parent (zero). This
13 printing means we can detect if we correctly get a zero result and a
14 non-zero result (--> three 'X's printed), but the output doesn't depend
15 on the order. */
16
17 printf("%s", pid==0 ? "X" : "XX");
njn25e49d8e72002-09-23 09:36:25 +000018
19 return 0;
20}