#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>


int main(int argc, char **argv)
{
  pid_t pid;

  pid = fork();

  if (pid < 0) {
    fprintf(stderr,"Error: can't fork a process\n");
    perror("fork()");
    exit(1);
  } else if (pid) { // I am the parent and I die
    exit(0); 
  } else {  // I am the child and I exit right away
    sleep(1);
    fprintf(stderr,"I am the child and my parent's pid is: %d\n",
 		getppid());
    exit(0);
  }
}

