
/* process creation in unix          */
/* Examples using system call fork  */

#include "myhdr.h"

int main()
{
  int pid;

  printf(" Parent: Just one process so far\n");
  printf(" Parent: Invoking/Calling fork() system call\n");

  pid = fork();  /* create new process*/

  if (pid == 0)
    printf(" \t \t \t Child: I am the child %d\n", getpid());
  else if (pid > 0)
    printf(" Parent: I am the parent, child has pid %d \n", pid);
  else
    printf(" Fork returned an error %d \n", pid);
  return 0;
}
