#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/time.h>
#include <sys/types.h>
#include <wait.h>


int main ()
{
  pid_t my_pid = getpid();
  pid_t rval;
  int i, n=2;

  for (i=0; i<n; i++) {

    rval = fork();

    if (rval == 0) {
      my_pid = getpid();
      printf ("%d child\n", my_pid);
    } else {
      printf ("%d parent of %d\n", my_pid, rval);
    }
  }

  return 0;
}
