#include <stdbool.h>      // for bool
#include <stdio.h>        // for printf
#include <unistd.h>       // for fork, getpid, getppid
#include "exit-utils.h"   // for our own exitIf
#include <assert.h>

static const int kForkFailed = 1;
int main(int argc, char *argv[])
{
  int x = 1;

  pid_t pid = fork();
  assert(pid >= 0);
  //exitIf(pid == -1, kForkFailed, stderr, "fork function failed.\n");
  
  if (pid == 0) { // in child (assumes no errors)
  	printf("x=%d\n", ++x); 
  }

  printf("x=%d\n", --x);   
  
  return 0;
}

