#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/wait.h>

int main(int argc, int *argv[]) {
  int pid = fork() ;
  if (pid == 0) {
    /* child */
    puts("This is the child.") ;
  } else {
    int status ;
    printf("This is the parent of %d\n", pid) ;
    wait(&status) ;
    if (status == -1) {
      puts("Huh!") ;
    } else {
      printf("Child %d has terminated\n", pid) ;
    }
  }
}



