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

int f;

int main (void)
{
  printf("\nBirinci program calisiyor: PID=%d \n",getpid());
  f=fork();
  if (f==0)  /*cocuk*/
  {
    printf("\nBen cocuk... PID= %d\n", getpid());
    printf("\nBen cocuk... Annemin PID'si= %d\n", getppid());
    //Bir surec icinde yeni bir program calistirir, yeni bir surec degildir!!! PID degismez
    execlp("./uyg2_2","./uyg2_2","a","b",(char *)NULL);
  }
  else /* anne */
    exit(0);
  return(0);  
}

