Old stuff/ecole_etude_fac_de_pau/licence_3/projet_commun_se/backup06/barman.c
(Deskargatu)
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <sys/types.h>
#include <errno.h>
#include <sys/shm.h>
#include "include/bar_gerer_com.h"
#include "include/bar_security.h"
#include "include/bar_ordo.h"
#include "include/blonde.h"
#include "include/brune.h"
int main(int argc, char** argv)
{
pid_t pid;
printf("Loading Com ...\n");
pid = fork();
if (pid == -1) { perror("main: Fork loop error"); exit(-1); }
if(pid == 0) { bar_gerer_com(); return (0); }
printf("OK\n");
printf("Loading Ordonnanceur ...\n");
pid = fork();
if (pid == -1) { perror("main: Fork loop error"); exit(-1); }
else if(pid == 0) { bar_ordo(); return (0); }
printf("OK\n");
printf("Loading Security ...\n");
pid = fork();
if (pid == -1) { perror("main: Fork loop error"); exit(-1); }
else if(pid == 0) { bar_security(); return (0); }
printf("OK\n");
printf("Loading tireuse blonde ...\n");
pid = fork();
if (pid == -1) { perror("main: Fork loop error"); exit(-1); }
else if(pid == 0) { go_blonde(); return (0); }
printf("OK\n");
printf("Loading tireuse brune ...\n");
pid = fork();
if (pid == -1) { perror("main: Fork loop error"); exit(-1); }
else if(pid == 0) { go_brune(); return (0); }
printf("OK\n");
return 0;
}