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

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


int main()
{
  int pid;

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

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

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

