Tfe

Ongi etorri tfe-ren webgunera...

Old stuff/ecole_etude_fac_de_pau/licence_3/systeme-d-exploitation/tp3/4.c~

(Deskargatu)
#include <sys/types.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>

int main(int argc, char** argv)
{

  struct sigaction action;
  action.sa_handler = fonction;
  sigemptyset(&action.sa_mask);
  if(signalaction(SIGCHLD,&action,NULL) == -1)
    {
      perror("signal action errror");
      exit(-1);
    }

  pid_t pid;
  pid = fork;
  if (pid == -1){
    perror("fork error");
    exit(-1);
  }
  else if (pid == 0)
    {
      printf("fils ... \n");
    }
  else
    {

      printf("pere \n");
    }


  return 0;
}