Tfe

Ongi etorri tfe-ren webgunera...

3.c~

Deskargatu
#include <stdlio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>


int main()
{
  pid_t pid;

  pid = fork();
  if (pid == -1 ) { perror("error fork"); exit(-1); }
  if (pid == 0)  
    {
      printf("Le fils a pour pid : %d\n",getpid());
    }
  else{
    wait(pid);
    printf("le pere a pour pid: %d\n",getpid());
    }



}