Diff for /rpl/src/rpl.c between versions 1.45 and 1.135

version 1.45, 2010/08/30 14:14:07 version 1.135, 2013/02/27 17:11:45
Line 1 Line 1
 /*  /*
 ================================================================================  ================================================================================
   RPL/2 (R) version 4.0.19    RPL/2 (R) version 4.1.13
   Copyright (C) 1989-2010 Dr. BERTRAND Joël    Copyright (C) 1989-2013 Dr. BERTRAND Joël
   
   This file is part of RPL/2.    This file is part of RPL/2.
   
Line 23 Line 23
 #define  MAIN_RPL  #define  MAIN_RPL
 #include "rpl-conv.h"  #include "rpl-conv.h"
   
 #ifdef SEMAPHORES_SYSV  
 #ifndef OS2  
     unsigned char       *chemin_semaphores_SysV;  
 #endif  
 #endif  
   
   
 /*  /*
 ================================================================================  ================================================================================
Line 37 Line 31
 */  */
   
 int  int
 rplinit(int argc, char *argv[], unsigned char ***resultats, char *rpl_home)  rplinit(int argc, char *argv[], char *envp[],
           unsigned char ***resultats, char *rpl_home)
 {  {
 #   include                             "copyright-conv.h"  #   include                             "copyright-conv.h"
 #   include                             "licence-conv.h"  #   include                             "licence-conv.h"
   
       char                                **arg_exec;
   
   #   ifdef HAVE_STACK_OVERFLOW_RECOVERY
       char                                pile_signaux[SIGSTKSZ];
   #   endif
   
   #   define RPL_PATH_MAX                 1024
       char                                repertoire_initial[RPL_PATH_MAX];
   
     file                                *f_source;      file                                *f_source;
   
     int                                 erreur_historique;      int                                 erreur_historique;
     int                                 option_P;      int                                 option_P;
     int                                 status;  
   
     logical1                            core;      logical1                            core;
     logical1                            debug;      logical1                            debug;
Line 77  rplinit(int argc, char *argv[], unsigned Line 80  rplinit(int argc, char *argv[], unsigned
   
     struct_processus                    *s_etat_processus;      struct_processus                    *s_etat_processus;
   
     struct_table_variables_partagees    s_variables_partagees;      struct_liste_variables_partagees    *l_element_partage_courant;
       struct_liste_variables_partagees    *l_element_partage_suivant;
   
       struct_liste_variables_statiques    *l_element_statique_courant;
       struct_liste_variables_statiques    *l_element_statique_suivant;
   
       struct_arbre_variables_partagees    *s_arbre_variables_partagees;
       struct_liste_variables_partagees    *l_liste_variables_partagees;
   
     struct sigaction                    action;      struct sigaction                    action;
     struct sigaction                    registre;      struct sigaction                    registre;
Line 106  rplinit(int argc, char *argv[], unsigned Line 116  rplinit(int argc, char *argv[], unsigned
     volatile unsigned char              traitement_fichier_temporaire;      volatile unsigned char              traitement_fichier_temporaire;
   
     errno = 0;      errno = 0;
       s_queue_signaux = NULL;
       routine_recursive = 0;
       pid_processus_pere = getpid();
   
 #   ifdef DEBUG_MEMOIRE  #   ifdef DEBUG_MEMOIRE
     debug_memoire_initialisation();      debug_memoire_initialisation();
Line 115  rplinit(int argc, char *argv[], unsigned Line 128  rplinit(int argc, char *argv[], unsigned
     setvbuf(stderr, NULL, _IOLBF, 0);      setvbuf(stderr, NULL, _IOLBF, 0);
   
 #   ifndef SEMAPHORES_NOMMES  #   ifndef SEMAPHORES_NOMMES
     sem_init(&semaphore_liste_threads, 0, 1);  
     sem_init(&semaphore_gestionnaires_signaux, 0, 0);      sem_init(&semaphore_gestionnaires_signaux, 0, 0);
     sem_init(&semaphore_gestionnaires_signaux_atomique, 0, 1);  
 #   else  #   else
     semaphore_liste_threads = sem_init2(1, sem_liste_threads);      semaphore_gestionnaires_signaux = sem_init2(0, getpid(), SEM_SIGNAUX);
     semaphore_gestionnaires_signaux = sem_init2(0, sem_gestionnaires_signaux);      
     semaphore_gestionnaires_signaux_atomique = sem_init2(1,      if (semaphore_gestionnaires_signaux == SEM_FAILED)
             sem_gestionnaires_signaux_atomique);  
   
     if ((semaphore_liste_threads == SEM_FAILED) ||  
             (semaphore_gestionnaires_signaux == SEM_FAILED) ||  
             (semaphore_gestionnaires_signaux_atomique == SEM_FAILED))  
     {      {
         erreur = d_es_allocation_memoire;          erreur = d_es_allocation_memoire;
   
Line 152  rplinit(int argc, char *argv[], unsigned Line 158  rplinit(int argc, char *argv[], unsigned
   
     if ((s_etat_processus = malloc(sizeof(struct_processus))) == NULL)      if ((s_etat_processus = malloc(sizeof(struct_processus))) == NULL)
     {      {
   #       ifndef SEMAPHORES_NOMMES
           sem_post(&semaphore_gestionnaires_signaux);
           sem_destroy(&semaphore_gestionnaires_signaux);
   #       else
           sem_post(semaphore_gestionnaires_signaux);
           sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX);
   #       endif
   
         erreur = d_es_allocation_memoire;          erreur = d_es_allocation_memoire;
   
         if ((langue = getenv("LANG")) != NULL)          if ((langue = getenv("LANG")) != NULL)
Line 183  rplinit(int argc, char *argv[], unsigned Line 197  rplinit(int argc, char *argv[], unsigned
         (*s_etat_processus).langue = 'E';          (*s_etat_processus).langue = 'E';
     }      }
   
       if (getcwd(repertoire_initial, RPL_PATH_MAX) == NULL)
       {
   #       ifndef SEMAPHORES_NOMMES
           sem_post(&semaphore_gestionnaires_signaux);
           sem_destroy(&semaphore_gestionnaires_signaux);
   #       else
           sem_post(semaphore_gestionnaires_signaux);
           sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX);
   #       endif
   
           if ((*s_etat_processus).langue == 'F')
           {
               uprintf("+++Système : Mémoire insuffisante\n");
           }
           else
           {
               uprintf("+++System : Not enough memory\n");
           }
   
           return(EXIT_FAILURE);
       }
   
       if ((arg_exec = malloc((argc + 1) * sizeof(char *))) == NULL)
       {
   #       ifndef SEMAPHORES_NOMMES
           sem_post(&semaphore_gestionnaires_signaux);
           sem_destroy(&semaphore_gestionnaires_signaux);
   #       else
           sem_post(semaphore_gestionnaires_signaux);
           sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX);
   #       endif
   
           if ((*s_etat_processus).langue == 'F')
           {
               uprintf("+++Système : Mémoire insuffisante\n");
           }
           else
           {
               uprintf("+++System : Not enough memory\n");
           }
   
           return(EXIT_FAILURE);
       }
   
       for(i = 0; i < (unsigned long) argc; i++)
       {
           arg_exec[i] = argv[i];
       }
   
       argv[argc] = NULL;
   
       initialisation_contexte_cas(s_etat_processus);
   
     (*s_etat_processus).exception = d_ep;      (*s_etat_processus).exception = d_ep;
     (*s_etat_processus).erreur_systeme = d_es;      (*s_etat_processus).erreur_systeme = d_es;
     (*s_etat_processus).erreur_execution = d_ex;      (*s_etat_processus).erreur_execution = d_ex;
   
       (*s_etat_processus).requete_redemarrage = d_faux;
     (*s_etat_processus).rpl_home = rpl_home;      (*s_etat_processus).rpl_home = rpl_home;
   
     pthread_mutexattr_init(&attributs_mutex);      pthread_mutexattr_init(&attributs_mutex);
Line 200  rplinit(int argc, char *argv[], unsigned Line 268  rplinit(int argc, char *argv[], unsigned
             &attributs_mutex);              &attributs_mutex);
     pthread_mutexattr_destroy(&attributs_mutex);      pthread_mutexattr_destroy(&attributs_mutex);
   
       pthread_mutexattr_init(&attributs_mutex);
       pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_RECURSIVE);
       pthread_mutex_init(&mutex_sections_critiques, &attributs_mutex);
       pthread_mutexattr_destroy(&attributs_mutex);
   
       pthread_mutexattr_init(&attributs_mutex);
       pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_RECURSIVE);
       pthread_mutex_init(&mutex_liste_variables_partagees, &attributs_mutex);
       pthread_mutexattr_destroy(&attributs_mutex);
   
 #   ifndef SEMAPHORES_NOMMES  #   ifndef SEMAPHORES_NOMMES
     sem_init(&((*s_etat_processus).semaphore_fork), 0, 0);          sem_init(&((*s_etat_processus).semaphore_fork), 0, 0);
 #   else  #   else
     if (((*s_etat_processus).semaphore_fork = sem_init2(0, sem_fork)) ==          if (((*s_etat_processus).semaphore_fork = sem_init3(0, getpid(),
             SEM_FAILED)                  pthread_self(), SEM_FORK)) == SEM_FAILED)
     {  
         if ((*s_etat_processus).langue == 'F')  
         {  
             uprintf("+++Système : Mémoire insuffisante\n");  
         }  
         else  
         {          {
             uprintf("+++System : Not enough memory\n");  #           ifndef SEMAPHORES_NOMMES
         }                  sem_post(&semaphore_gestionnaires_signaux);
                   sem_destroy(&semaphore_gestionnaires_signaux);
   #           else
                   sem_post(semaphore_gestionnaires_signaux);
                   sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                           SEM_SIGNAUX);
   #           endif
   
         return(EXIT_FAILURE);              liberation(contexte_cas(s_etat_processus);
     }  
               if ((*s_etat_processus).langue == 'F')
               {
                   uprintf("+++Système : Mémoire insuffisante\n");
               }
               else
               {
                   uprintf("+++System : Not enough memory\n");
               }
   
               return(EXIT_FAILURE);
           }
 #   endif  #   endif
   
     pthread_mutexattr_init(&attributs_mutex);      pthread_mutexattr_init(&attributs_mutex);
Line 225  rplinit(int argc, char *argv[], unsigned Line 314  rplinit(int argc, char *argv[], unsigned
             &attributs_mutex);              &attributs_mutex);
     pthread_mutexattr_destroy(&attributs_mutex);      pthread_mutexattr_destroy(&attributs_mutex);
   
     (*s_etat_processus).s_liste_variables_partagees = &s_variables_partagees;  
   
     s_variables_partagees.nombre_variables = 0;  
     s_variables_partagees.nombre_variables_allouees = 0;  
     s_variables_partagees.table = NULL;  
   
     pthread_mutexattr_init(&attributs_mutex);  
     pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL);  
     pthread_mutex_init(&((*((*s_etat_processus).s_liste_variables_partagees))  
             .mutex), &attributs_mutex);  
     pthread_mutexattr_destroy(&attributs_mutex);  
   
     (*s_etat_processus).chemin_fichiers_temporaires =      (*s_etat_processus).chemin_fichiers_temporaires =
             recherche_chemin_fichiers_temporaires(s_etat_processus);              recherche_chemin_fichiers_temporaires(s_etat_processus);
   
 #   ifdef SEMAPHORES_SYSV  
 #   ifndef OS2  
     chemin_semaphores_SysV = (*s_etat_processus).chemin_fichiers_temporaires;  
 #   endif  
 #   endif  
   
 #   ifdef _BROKEN_SIGINFO  
     creation_fifos_signaux(s_etat_processus);  
 #   ifdef return  
 #       undef return  
 #   endif  
 #   define return destruction_fifos_signaux(s_etat_processus); return  
 #   endif  
   
     insertion_thread(s_etat_processus, d_vrai);      insertion_thread(s_etat_processus, d_vrai);
       creation_queue_signaux(s_etat_processus);
   
 #   ifndef OS2  
     localisation_courante(s_etat_processus);  
 #   else  
     if ((*s_etat_processus).erreur_systeme != d_es)      if ((*s_etat_processus).erreur_systeme != d_es)
     {      {
         if (((*s_etat_processus).localisation = malloc((strlen(d_locale) + 1) *  #       ifndef SEMAPHORES_NOMMES
                 sizeof(unsigned char))) == NULL)              sem_post(&((*s_etat_processus).semaphore_fork));
               sem_post(&semaphore_gestionnaires_signaux);
               sem_destroy(&semaphore_gestionnaires_signaux);
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_post(semaphore_gestionnaires_signaux);
               sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                       SEM_SIGNAUX);
               sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
   
           if ((*s_etat_processus).langue == 'F')
           {
               uprintf("+++Système : Mémoire insuffisante\n");
           }
           else
           {
               uprintf("+++System : Not enough memory\n");
           }
   
           return(EXIT_FAILURE);
       }
   
       if (d_forced_locale == 0)
       {
           localisation_courante(s_etat_processus);
       }
       else
       {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_post(&semaphore_gestionnaires_signaux);
               sem_destroy(&semaphore_gestionnaires_signaux);
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_post(semaphore_gestionnaires_signaux);
               sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                       SEM_SIGNAUX);
               sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           liberation_queue_signaux(s_etat_processus);
   
           if (((*s_etat_processus).localisation = malloc((strlen(d_locale)
                   + 1) * sizeof(unsigned char))) == NULL)
         {          {
             if ((*s_etat_processus).langue == 'F')              if ((*s_etat_processus).langue == 'F')
             {              {
Line 278  rplinit(int argc, char *argv[], unsigned Line 390  rplinit(int argc, char *argv[], unsigned
   
         strcpy((*s_etat_processus).localisation, d_locale);          strcpy((*s_etat_processus).localisation, d_locale);
     }      }
 #   endif  
   
     (*s_etat_processus).erreur_systeme = d_es;      (*s_etat_processus).erreur_systeme = d_es;
   
Line 287  rplinit(int argc, char *argv[], unsigned Line 398  rplinit(int argc, char *argv[], unsigned
         if (((*s_etat_processus).localisation = malloc((strlen(d_locale) + 1) *          if (((*s_etat_processus).localisation = malloc((strlen(d_locale) + 1) *
                 sizeof(unsigned char))) == NULL)                  sizeof(unsigned char))) == NULL)
         {          {
   #           ifndef SEMAPHORES_NOMMES
                   sem_post(&((*s_etat_processus).semaphore_fork));
                   sem_post(&semaphore_gestionnaires_signaux);
                   sem_destroy(&semaphore_gestionnaires_signaux);
                   sem_destroy(&((*s_etat_processus).semaphore_fork));
   #           else
                   sem_post((*s_etat_processus).semaphore_fork);
                   sem_post(semaphore_gestionnaires_signaux);
                   sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                           SEM_SIGNAUX);
                   sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
                           pthread_self(), SEM_FORK);
   #           endif
   
               liberation_contexte_cas(s_etat_processus);
               liberation_queue_signaux(s_etat_processus);
   
             if ((*s_etat_processus).langue == 'F')              if ((*s_etat_processus).langue == 'F')
             {              {
                 uprintf("+++Système : Mémoire insuffisante\n");                  uprintf("+++Système : Mémoire insuffisante\n");
Line 307  rplinit(int argc, char *argv[], unsigned Line 435  rplinit(int argc, char *argv[], unsigned
   
     if ((*s_etat_processus).langue == 'F')      if ((*s_etat_processus).langue == 'F')
     {      {
         printf("+++Copyright (C) 1989 à 2009, 2010 BERTRAND Joël\n");          printf("+++Copyright (C) 1989 à 2012, 2013 BERTRAND Joël\n");
     }      }
     else      else
     {      {
         printf("+++Copyright (C) 1989 to 2009, 2010 BERTRAND Joel\n");          printf("+++Copyright (C) 1989 to 2012, 2013 BERTRAND Joel\n");
     }      }
   
     if (getenv("HOME") != NULL)      if (getenv("HOME") != NULL)
Line 336  rplinit(int argc, char *argv[], unsigned Line 464  rplinit(int argc, char *argv[], unsigned
         home = "";          home = "";
     }      }
   
     // Initialisation d'une clef  #   ifdef HAVE_STACK_OVERFLOW_RECOVERY
           if (stackoverflow_install_handler(interruption_depassement_pile,
                   pile_signaux, sizeof(pile_signaux)) != 0)
           {
   #           ifndef SEMAPHORES_NOMMES
                   sem_post(&((*s_etat_processus).semaphore_fork));
                   sem_post(&semaphore_gestionnaires_signaux);
                   sem_destroy(&semaphore_gestionnaires_signaux);
                   sem_destroy(&((*s_etat_processus).semaphore_fork));
   #           else
                   sem_post((*s_etat_processus).semaphore_fork);
                   sem_post(semaphore_gestionnaires_signaux);
                   sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                           SEM_SIGNAUX);
                   sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
                           pthread_self(), SEM_FORK);
   #           endif
   
     if (pthread_key_create(&semaphore_fork_processus_courant, NULL) != 0)              liberation_contexte_cas(s_etat_processus);
     {              liberation_queue_signaux(s_etat_processus);
         if ((*s_etat_processus).langue == 'F')  
         {  
             printf("+++Système : Mémoire insuffisante\n");  
         }  
         else  
         {  
             printf("+++System : Not enough memory\n");  
         }  
   
         return(EXIT_FAILURE);              erreur = d_es_signal;
     }  
   
 #   ifndef SEMAPHORES_NOMMES              if ((*s_etat_processus).langue == 'F')
     if (pthread_setspecific(semaphore_fork_processus_courant,              {
             &((*s_etat_processus).semaphore_fork)) != 0)                  printf("+++Système : Initialisation de la pile alternative "
                           "impossible\n");
               }
               else
               {
                   printf("+++System : Initialization of alternate "
                           "stack failed\n");
               }
   
               return(EXIT_FAILURE);
           }
 #   else  #   else
     if (pthread_setspecific(semaphore_fork_processus_courant,  
             (*s_etat_processus).semaphore_fork) != 0)  
 #   endif  
     {  
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
         {          {
             printf("+++Système : Mémoire insuffisante\n");              printf("+++Attention : Le système ne supporte pas de pile "
                       "alternative\n");
         }          }
         else          else
         {          {
             printf("+++System : Not enough memory\n");              printf("+++Warning : Operating system does not support alternate "
                       "stack\n");
         }          }
   #   endif
   
         return(EXIT_FAILURE);      if (lancement_thread_signaux(s_etat_processus) != d_absence_erreur)
     }  
   
     // Initialisation d'une pile de signal pour récupérer les  
     // débordement de pile  
   
 #   if !defined(Cygwin) && !defined(OpenBSD)  
     if (((*s_etat_processus).pile_signal.ss_sp =  
             malloc((*s_etat_processus).pile_signal.ss_size =  
             SIGSTKSZ)) == NULL)  
     {      {
         erreur = d_es_allocation_memoire;  #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_post(&semaphore_gestionnaires_signaux);
               sem_destroy(&semaphore_gestionnaires_signaux);
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_post(semaphore_gestionnaires_signaux);
               sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                       SEM_SIGNAUX);
               sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           liberation_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
           erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
         {          {
             printf("+++Système : Mémoire insuffisante\n");              printf("+++Système : Initialisation des signaux POSIX "
                       "impossible\n");
         }          }
         else          else
         {          {
             printf("+++System : Not enough memory\n");              printf("+++System : Initialization of POSIX signals failed\n");
         }          }
   
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
     (*s_etat_processus).pile_signal.ss_flags = 0;      action.sa_handler = interruption1;
       action.sa_flags = 0;
   
     if (sigaltstack(&((*s_etat_processus).pile_signal), NULL) != 0)      if (sigaction(SIGINT, &action, NULL) != 0)
     {      {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_post(&semaphore_gestionnaires_signaux);
               sem_destroy(&semaphore_gestionnaires_signaux);
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_post(semaphore_gestionnaires_signaux);
               sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                       SEM_SIGNAUX);
               sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           liberation_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
         erreur = d_es_signal;          erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
         {          {
             printf("+++Système : Initialisation de la pile spécifique de signal"              printf("+++Système : Initialisation des signaux POSIX "
                     " impossible\n");                      "impossible\n");
         }          }
         else          else
         {          {
             printf("+++System : Initialization of signal stack failed\n");              printf("+++System : Initialization of POSIX signals failed\n");
         }          }
   
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
 #   endif  
   
 #   ifndef _BROKEN_SIGINFO      signal_test = SIGTEST;
     action.sa_sigaction = interruption1;      raise(SIGINT);
 #   else  
     action.sa_handler = interruption1;  
 #   endif  
     action.sa_flags = SA_ONSTACK | SA_SIGINFO;  
   
     if (sigaction(SIGINT, &action, NULL) != 0)      attente.tv_sec = 0;
       attente.tv_nsec = 1000000;
   
       for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
       {
           nanosleep(&attente, NULL);
       }
   
       if (signal_test != SIGINT)
     {      {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_post(&semaphore_gestionnaires_signaux);
               sem_destroy(&semaphore_gestionnaires_signaux);
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_post(semaphore_gestionnaires_signaux);
               sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                       SEM_SIGNAUX);
               sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           liberation_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
         erreur = d_es_signal;          erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
Line 438  rplinit(int argc, char *argv[], unsigned Line 641  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
 #   ifndef _BROKEN_SIGINFO      if (sigaction(SIGTERM, &action, NULL) != 0)
     action.sa_sigaction = interruption2;  
 #   else  
     action.sa_handler = interruption2;  
 #   endif  
     action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO;  
   
     if (sigaction(SIGTSTP, &action, NULL) != 0)  
     {      {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_post(&semaphore_gestionnaires_signaux);
               sem_destroy(&semaphore_gestionnaires_signaux);
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_post(semaphore_gestionnaires_signaux);
               sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                       SEM_SIGNAUX);
               sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           liberation_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
           erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
         {          {
             printf("+++Système : Initialisation des signaux POSIX "              printf("+++Système : Initialisation des signaux POSIX "
Line 460  rplinit(int argc, char *argv[], unsigned Line 679  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
 #   ifndef _BROKEN_SIGINFO      signal_test = SIGTEST;
     action.sa_sigaction = interruption4;      raise(SIGTERM);
 #   else  
     action.sa_handler = interruption4;      attente.tv_sec = 0;
 #   endif      attente.tv_nsec = 1000000;
     // SIGCONT ne doit pas pouvoir être appelé depuis son gestionnaire.  
     action.sa_flags = SA_ONSTACK | SA_SIGINFO;      for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
       {
           nanosleep(&attente, NULL);
       }
   
     if (sigaction(SIGSTART, &action, NULL) != 0)      if (signal_test != SIGTERM)
     {      {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_post(&semaphore_gestionnaires_signaux);
               sem_destroy(&semaphore_gestionnaires_signaux);
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_post(semaphore_gestionnaires_signaux);
               sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                       SEM_SIGNAUX);
               sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           liberation_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
           erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
         {          {
             printf("+++Système : Initialisation des signaux POSIX "              printf("+++Système : Initialisation des signaux POSIX "
Line 483  rplinit(int argc, char *argv[], unsigned Line 728  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
     if (sigaction(SIGCONT, &action, NULL) != 0)      if (sigaction(SIGALRM, &action, NULL) != 0)
     {      {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_post(&semaphore_gestionnaires_signaux);
               sem_destroy(&semaphore_gestionnaires_signaux);
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_post(semaphore_gestionnaires_signaux);
               sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                       SEM_SIGNAUX);
               sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           liberation_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
           erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
         {          {
             printf("+++Système : Initialisation des signaux POSIX "              printf("+++Système : Initialisation des signaux POSIX "
Line 498  rplinit(int argc, char *argv[], unsigned Line 766  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
 #   ifndef _BROKEN_SIGINFO      signal_test = SIGTEST;
     action.sa_sigaction = interruption5;      raise(SIGALRM);
 #   else  
     action.sa_handler = interruption5;      attente.tv_sec = 0;
 #   endif      attente.tv_nsec = 1000000;
     action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO;  
   
     if (sigaction(SIGFSTOP, &action, NULL) != 0)      for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
     {      {
           nanosleep(&attente, NULL);
       }
   
       if (signal_test != SIGALRM)
       {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_post(&semaphore_gestionnaires_signaux);
               sem_destroy(&semaphore_gestionnaires_signaux);
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_post(semaphore_gestionnaires_signaux);
               sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                       SEM_SIGNAUX);
               sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           liberation_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
         erreur = d_es_signal;          erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
Line 522  rplinit(int argc, char *argv[], unsigned Line 815  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
 #   ifndef _BROKEN_SIGINFO      action.sa_handler = interruption2;
     action.sa_sigaction = interruption11;      action.sa_flags = 0;
 #   else  
     action.sa_handler = interruption11;  
 #   endif  
     action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO;  
   
     if (sigaction(SIGFABORT, &action, NULL) != 0)      if (sigaction(SIGTSTP, &action, NULL) != 0)
     {      {
         erreur = d_es_signal;  #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_post(&semaphore_gestionnaires_signaux);
               sem_destroy(&semaphore_gestionnaires_signaux);
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_post(semaphore_gestionnaires_signaux);
               sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                       SEM_SIGNAUX);
               sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           liberation_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
         {          {
Line 546  rplinit(int argc, char *argv[], unsigned Line 854  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
 #   ifndef _BROKEN_SIGINFO      signal_test = SIGTEST;
     action.sa_sigaction = interruption8;      raise(SIGTSTP);
 #   else  
     action.sa_handler = interruption8;      attente.tv_sec = 0;
 #   endif      attente.tv_nsec = 1000000;
     action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO;  
   
     if (sigaction(SIGURG, &action, NULL) != 0)      for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
     {      {
           nanosleep(&attente, NULL);
       }
   
       if (signal_test != SIGTSTP)
       {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_post(&semaphore_gestionnaires_signaux);
               sem_destroy(&semaphore_gestionnaires_signaux);
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_post(semaphore_gestionnaires_signaux);
               sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                       SEM_SIGNAUX);
               sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           liberation_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
         erreur = d_es_signal;          erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
Line 570  rplinit(int argc, char *argv[], unsigned Line 903  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
 #   ifndef _BROKEN_SIGINFO      action.sa_handler = interruption5;
     action.sa_sigaction = interruption7;      action.sa_flags = 0;
 #   else  
     action.sa_handler = interruption7;  
 #   endif  
     action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO;  
   
     if (sigaction(SIGPIPE, &action, NULL) != 0)      if (sigaction(SIGPIPE, &action, NULL) != 0)
     {      {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_post(&semaphore_gestionnaires_signaux);
               sem_destroy(&semaphore_gestionnaires_signaux);
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_post(semaphore_gestionnaires_signaux);
               sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                       SEM_SIGNAUX);
               sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           liberation_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
         erreur = d_es_signal;          erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
Line 594  rplinit(int argc, char *argv[], unsigned Line 944  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
 #   ifndef _BROKEN_SIGINFO      signal_test = SIGTEST;
     action.sa_sigaction = interruption6;      raise(SIGPIPE);
 #   else  
     action.sa_handler = interruption6;      attente.tv_sec = 0;
 #   endif      attente.tv_nsec = 1000000;
     action.sa_flags = SA_ONSTACK | SA_SIGINFO | SA_NODEFER;  
       for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
       {
           nanosleep(&attente, NULL);
       }
   
     if (sigaction(SIGINJECT, &action, NULL) != 0)      if (signal_test != SIGPIPE)
     {      {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_post(&semaphore_gestionnaires_signaux);
               sem_destroy(&semaphore_gestionnaires_signaux);
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_post(semaphore_gestionnaires_signaux);
               sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                       SEM_SIGNAUX);
               sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           liberation_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
         erreur = d_es_signal;          erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
Line 618  rplinit(int argc, char *argv[], unsigned Line 993  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
 #   ifndef _BROKEN_SIGINFO      action.sa_handler = interruption1;
     action.sa_sigaction = interruption9;      action.sa_flags = 0;
 #   else  
     action.sa_handler = interruption9;  
 #   endif  
     action.sa_flags = SA_ONSTACK | SA_SIGINFO | SA_NODEFER;  
   
     if (sigaction(SIGABORT, &action, NULL) != 0)      if (sigaction(SIGUSR1, &action, NULL) != 0)
     {      {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_post(&semaphore_gestionnaires_signaux);
               sem_destroy(&semaphore_gestionnaires_signaux);
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_post(semaphore_gestionnaires_signaux);
               sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                       SEM_SIGNAUX);
               sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           liberation_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
         erreur = d_es_signal;          erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
Line 642  rplinit(int argc, char *argv[], unsigned Line 1034  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
 #   ifndef _BROKEN_SIGINFO      signal_test = SIGTEST;
     action.sa_sigaction = interruption1;      raise(SIGUSR1);
 #   else  
     action.sa_handler = interruption1;  
 #   endif  
     action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO;  
   
     if (sigaction(SIGALRM, &action, NULL) != 0)      attente.tv_sec = 0;
       attente.tv_nsec = 1000000;
   
       for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
       {
           nanosleep(&attente, NULL);
       }
   
       if (signal_test != SIGUSR1)
     {      {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_post(&semaphore_gestionnaires_signaux);
               sem_destroy(&semaphore_gestionnaires_signaux);
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_post(semaphore_gestionnaires_signaux);
               sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
                       SEM_SIGNAUX);
               sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           liberation_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
         erreur = d_es_signal;          erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
Line 666  rplinit(int argc, char *argv[], unsigned Line 1083  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
 #   ifndef _BROKEN_SIGINFO      signal_test = SIGTEST + 1;
     action.sa_sigaction = interruption3;  
 #   else  
     action.sa_handler = interruption3;  
 #   endif  
     action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO;  
   
     erreur = d_absence_erreur;      erreur = d_absence_erreur;
     core = d_faux;      core = d_faux;
Line 719  rplinit(int argc, char *argv[], unsigned Line 1131  rplinit(int argc, char *argv[], unsigned
         option_t = d_faux;          option_t = d_faux;
         option_v = d_faux;          option_v = d_faux;
   
           // Lorsque le programme est appelé depuis un shebang, argv[0] contient
           // le chemin du programme et argv[1] tous les arguments.
           // argv[2] contient quant à lui le nom du script RPL/2.
           //
           // Exemple :
           // argv[0] : /usr/local/bin/rpl
           // argv[1] : -csdp -t 800
           // argv[2] : ./on_exit.rpl
   
         while((--argc) > 0)          while((--argc) > 0)
         {          {
             if ((*(++argv))[0] == '-')              if ((*(++argv))[0] == '-')
Line 731  rplinit(int argc, char *argv[], unsigned Line 1152  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_a == d_vrai)                              if (option_a == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -a présente "                                      printf("+++Erreur : option -a présente "
Line 753  rplinit(int argc, char *argv[], unsigned Line 1196  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_A == d_vrai)                              if (option_A == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -A présente "                                      printf("+++Erreur : option -A présente "
Line 777  rplinit(int argc, char *argv[], unsigned Line 1242  rplinit(int argc, char *argv[], unsigned
                                 if ((arguments = malloc((strlen(argv[0]) + 7) *                                  if ((arguments = malloc((strlen(argv[0]) + 7) *
                                         sizeof(unsigned char))) == NULL)                                          sizeof(unsigned char))) == NULL)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_post(&semaphore_gestionnaires_signaux);
                                       sem_destroy(
                                               &semaphore_gestionnaires_signaux);
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_post(semaphore_gestionnaires_signaux);
                                       sem_destroy2(
                                               semaphore_gestionnaires_signaux,
                                               getpid(), SEM_SIGNAUX);
                                       sem_destroy3((*s_etat_processus)
                                               .semphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       liberation_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                     if ((*s_etat_processus).langue == 'F')                                      if ((*s_etat_processus).langue == 'F')
                                     {                                      {
                                         printf("+++Système : Mémoire "                                          printf("+++Système : Mémoire "
Line 813  rplinit(int argc, char *argv[], unsigned Line 1305  rplinit(int argc, char *argv[], unsigned
                                 if ((arguments = malloc((strlen(argv[0]) + 7) *                                  if ((arguments = malloc((strlen(argv[0]) + 7) *
                                         sizeof(unsigned char))) == NULL)                                          sizeof(unsigned char))) == NULL)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_post(&semaphore_gestionnaires_signaux);
                                       sem_destroy(
                                               &semaphore_gestionnaires_signaux);
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_post(semaphore_gestionnaires_signaux);
                                       sem_destroy2(
                                               semaphore_gestionnaires_signaux,
                                               getpid(), SEM_SIGNAUX);
                                       sem_destroy3((*s_etat_processus)
                                               .semphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       liberation_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                     if ((*s_etat_processus).langue == 'F')                                      if ((*s_etat_processus).langue == 'F')
                                     {                                      {
                                         printf("+++Système : Mémoire "                                          printf("+++Système : Mémoire "
Line 844  rplinit(int argc, char *argv[], unsigned Line 1363  rplinit(int argc, char *argv[], unsigned
                             }                              }
                             else                              else
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : Aucune donnée "                                      printf("+++Erreur : Aucune donnée "
Line 865  rplinit(int argc, char *argv[], unsigned Line 1406  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_c == d_vrai)                              if (option_c == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -c présente "                                      printf("+++Erreur : option -c présente "
Line 888  rplinit(int argc, char *argv[], unsigned Line 1451  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_d == d_vrai)                              if (option_d == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -d présente "                                      printf("+++Erreur : option -d présente "
Line 911  rplinit(int argc, char *argv[], unsigned Line 1496  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_D == d_vrai)                              if (option_D == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -D présente "                                      printf("+++Erreur : option -D présente "
Line 933  rplinit(int argc, char *argv[], unsigned Line 1540  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_h == d_vrai)                              if (option_h == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -h présente "                                      printf("+++Erreur : option -h présente "
Line 956  rplinit(int argc, char *argv[], unsigned Line 1585  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_i == d_vrai)                               if (option_i == d_vrai) 
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -i présente "                                      printf("+++Erreur : option -i présente "
Line 971  rplinit(int argc, char *argv[], unsigned Line 1622  rplinit(int argc, char *argv[], unsigned
                             }                              }
                             else if (option_S == d_vrai)                              else if (option_S == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : options -i et -S "                                      printf("+++Erreur : options -i et -S "
Line 986  rplinit(int argc, char *argv[], unsigned Line 1659  rplinit(int argc, char *argv[], unsigned
                             }                              }
                             else if (option_p == d_vrai)                              else if (option_p == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : options -i et -p "                                      printf("+++Erreur : options -i et -p "
Line 1010  rplinit(int argc, char *argv[], unsigned Line 1705  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_l == d_vrai)                              if (option_l == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -l présente "                                      printf("+++Erreur : option -l présente "
Line 1042  rplinit(int argc, char *argv[], unsigned Line 1759  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_n == d_vrai)                              if (option_n == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -n présente "                                      printf("+++Erreur : option -n présente "
Line 1065  rplinit(int argc, char *argv[], unsigned Line 1804  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_p == d_vrai)                              if (option_p == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -p présente "                                      printf("+++Erreur : option -p présente "
Line 1080  rplinit(int argc, char *argv[], unsigned Line 1841  rplinit(int argc, char *argv[], unsigned
                             }                              }
                             else if (option_i == d_vrai)                              else if (option_i == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : options -i et -p "                                      printf("+++Erreur : options -i et -p "
Line 1103  rplinit(int argc, char *argv[], unsigned Line 1886  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_P > 2)                              if (option_P > 2)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -P présente "                                      printf("+++Erreur : option -P présente "
Line 1126  rplinit(int argc, char *argv[], unsigned Line 1931  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_s == d_vrai)                              if (option_s == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -s présente "                                      printf("+++Erreur : option -s présente "
Line 1149  rplinit(int argc, char *argv[], unsigned Line 1976  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_S == d_vrai)                              if (option_S == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -S présente "                                      printf("+++Erreur : option -S présente "
Line 1164  rplinit(int argc, char *argv[], unsigned Line 2013  rplinit(int argc, char *argv[], unsigned
                             }                              }
                             else if (option_i == d_vrai)                              else if (option_i == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : options -i et -S "                                      printf("+++Erreur : options -i et -S "
Line 1189  rplinit(int argc, char *argv[], unsigned Line 2060  rplinit(int argc, char *argv[], unsigned
                                         malloc((strlen(argv[0]) + 1) *                                          malloc((strlen(argv[0]) + 1) *
                                         sizeof(unsigned char))) == NULL)                                          sizeof(unsigned char))) == NULL)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_post(&semaphore_gestionnaires_signaux);
                                       sem_destroy(
                                               &semaphore_gestionnaires_signaux);
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_post(semaphore_gestionnaires_signaux);
                                       sem_destroy2(
                                               semaphore_gestionnaires_signaux,
                                               getpid(), SEM_SIGNAUX);
                                       sem_destroy3((*s_etat_processus)
                                               .semphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       liberation_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                     if ((*s_etat_processus).langue == 'F')                                      if ((*s_etat_processus).langue == 'F')
                                     {                                      {
                                         printf("+++Système : Mémoire "                                          printf("+++Système : Mémoire "
Line 1223  rplinit(int argc, char *argv[], unsigned Line 2121  rplinit(int argc, char *argv[], unsigned
                                         malloc((strlen(argv[0]) + 1) *                                          malloc((strlen(argv[0]) + 1) *
                                         sizeof(unsigned char))) == NULL)                                          sizeof(unsigned char))) == NULL)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_post(&semaphore_gestionnaires_signaux);
                                       sem_destroy(
                                               &semaphore_gestionnaires_signaux);
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_post(semaphore_gestionnaires_signaux);
                                       sem_destroy2(
                                               semaphore_gestionnaires_signaux,
                                               getpid(), SEM_SIGNAUX);
                                       sem_destroy3((*s_etat_processus)
                                               .semphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       liberation_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                     if ((*s_etat_processus).langue == 'F')                                      if ((*s_etat_processus).langue == 'F')
                                     {                                      {
                                         printf("+++Système : Mémoire "                                          printf("+++Système : Mémoire "
Line 1251  rplinit(int argc, char *argv[], unsigned Line 2176  rplinit(int argc, char *argv[], unsigned
                             }                              }
                             else                              else
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : Aucun script "                                      printf("+++Erreur : Aucun script "
Line 1269  rplinit(int argc, char *argv[], unsigned Line 2216  rplinit(int argc, char *argv[], unsigned
                                     compactage((*s_etat_processus)                                      compactage((*s_etat_processus)
                                     .definitions_chainees)) == NULL)                                      .definitions_chainees)) == NULL)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Système : Mémoire "                                      printf("+++Système : Mémoire "
Line 1294  rplinit(int argc, char *argv[], unsigned Line 2263  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_t == d_vrai)                              if (option_t == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -t présente "                                      printf("+++Erreur : option -t présente "
Line 1319  rplinit(int argc, char *argv[], unsigned Line 2310  rplinit(int argc, char *argv[], unsigned
                                 if ((type_debug = malloc((strlen(argv[0]) + 1) *                                  if ((type_debug = malloc((strlen(argv[0]) + 1) *
                                         sizeof(unsigned char))) == NULL)                                          sizeof(unsigned char))) == NULL)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_post(&semaphore_gestionnaires_signaux);
                                       sem_destroy(
                                               &semaphore_gestionnaires_signaux);
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_post(semaphore_gestionnaires_signaux);
                                       sem_destroy2(
                                               semaphore_gestionnaires_signaux,
                                               getpid(), SEM_SIGNAUX);
                                       sem_destroy3((*s_etat_processus)
                                               .semphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       liberation_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                     if ((*s_etat_processus).langue == 'F')                                      if ((*s_etat_processus).langue == 'F')
                                     {                                      {
                                         printf("+++Système : Mémoire "                                          printf("+++Système : Mémoire "
Line 1353  rplinit(int argc, char *argv[], unsigned Line 2371  rplinit(int argc, char *argv[], unsigned
                                         malloc((strlen(argv[0]) + 1) *                                          malloc((strlen(argv[0]) + 1) *
                                         sizeof(unsigned char))) == NULL)                                          sizeof(unsigned char))) == NULL)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_post(&semaphore_gestionnaires_signaux);
                                       sem_destroy(
                                               &semaphore_gestionnaires_signaux);
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_post(semaphore_gestionnaires_signaux);
                                       sem_destroy2(
                                               semaphore_gestionnaires_signaux,
                                               getpid(), SEM_SIGNAUX);
                                       sem_destroy3((*s_etat_processus)
                                               .semphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       liberation_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                     if ((*s_etat_processus).langue == 'F')                                      if ((*s_etat_processus).langue == 'F')
                                     {                                      {
                                         printf("+++Système : Mémoire "                                          printf("+++Système : Mémoire "
Line 1380  rplinit(int argc, char *argv[], unsigned Line 2425  rplinit(int argc, char *argv[], unsigned
                             }                              }
                             else                              else
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : Aucun niveau "                                      printf("+++Erreur : Aucun niveau "
Line 1423  rplinit(int argc, char *argv[], unsigned Line 2490  rplinit(int argc, char *argv[], unsigned
   
                                     default:                                      default:
                                     {                                      {
   #                                       ifndef SEMAPHORES_NOMMES
                                           sem_post(&((*s_etat_processus)
                                                   .semaphore_fork));
                                           sem_post(
                                                   &semaphore_gestionnaires_signaux
                                                   );
                                           sem_destroy(
                                                   &semaphore_gestionnaires_signaux
                                                   );
                                           sem_destroy(&((*s_etat_processus)
                                                   .semaphore_fork));
   #                                       else
                                           sem_post((*s_etat_processus)
                                                   .semaphore_fork);
                                           sem_post(
                                                   semaphore_gestionnaires_signaux
                                                   );
                                           sem_destroy2(
                                                   semaphore_gestionnaires_signaux,
                                                   getpid(), SEM_SIGNAUX);
                                           sem_destroy3((*s_etat_processus)
                                                   .semphore_fork, getpid(),
                                                   pthread_self(), SEM_FORK);
   #                                       endif
   
                                           liberation_contexte_cas(
                                                   s_etat_processus);
                                           liberation_queue_signaux(
                                                   s_etat_processus);
   
   #                                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                           stackoverflow_deinstall_handler();
   #                                       endif
   
                                         if ((*s_etat_processus).langue == 'F')                                          if ((*s_etat_processus).langue == 'F')
                                         {                                          {
                                             printf("+++Erreur : Niveau "                                              printf("+++Erreur : Niveau "
Line 1446  rplinit(int argc, char *argv[], unsigned Line 2547  rplinit(int argc, char *argv[], unsigned
                             if (sscanf(type_debug, "%llX",                              if (sscanf(type_debug, "%llX",
                                     &((*s_etat_processus).type_debug)) != 1)                                      &((*s_etat_processus).type_debug)) != 1)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : Niveau "                                      printf("+++Erreur : Niveau "
Line 1468  rplinit(int argc, char *argv[], unsigned Line 2591  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_v == d_vrai)                              if (option_v == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -v présente "                                      printf("+++Erreur : option -v présente "
Line 1514  rplinit(int argc, char *argv[], unsigned Line 2659  rplinit(int argc, char *argv[], unsigned
                             break;                              break;
                         }                          }
   
                           case '-':
                           case ' ':
                           {
                               break;
                           }
   
                         default :                          default :
                         {                          {
                             if ((*s_etat_processus).langue == 'F')                              if ((*s_etat_processus).langue == 'F')
Line 1558  rplinit(int argc, char *argv[], unsigned Line 2709  rplinit(int argc, char *argv[], unsigned
             }              }
         }          }
   
           /*
            * Dans le cas où le programme est appelé avec l'option -d,
            * on ne récupère par les signaux de violation d'accès. On
            * tente simplement la récupération des dépassements de pile.
            */
   
         if (debug == d_faux)          if (debug == d_faux)
         {          {
   #   ifdef HAVE_SIGSEGV_RECOVERY
               if (sigsegv_install_handler(interruption_violation_access) != 0)
               {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_post(&semaphore_gestionnaires_signaux);
                       sem_destroy(&semaphore_gestionnaires_signaux);
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_post(semaphore_gestionnaires_signaux);
                       sem_destroy2(semaphore_gestionnaires_signaux,
                               getpid(), SEM_SIGNAUX);
                       sem_destroy3((*s_etat_processus).semphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   liberation_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
                   erreur = d_es_signal;
   
                   if ((*s_etat_processus).langue == 'F')
                   {
                       printf("+++Système : Initialisation de la pile alternative "
                               "impossible\n");
                   }
                   else
                   {
                       printf("+++System : Initialization of alternate "
                               "stack failed\n");
                   }
   
                   return(EXIT_FAILURE);
               }
   #   else
               action.sa_handler = interruption3;
               action.sa_flags = 0;
   
             if (sigaction(SIGSEGV, &action, NULL) != 0)              if (sigaction(SIGSEGV, &action, NULL) != 0)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_post(&semaphore_gestionnaires_signaux);
                       sem_destroy(&semaphore_gestionnaires_signaux);
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_post(semaphore_gestionnaires_signaux);
                       sem_destroy2(semaphore_gestionnaires_signaux,
                               getpid(), SEM_SIGNAUX);
                       sem_destroy3((*s_etat_processus).semphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   liberation_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
                   if ((*s_etat_processus).langue == 'F')
                   {
                       printf("+++Système : Initialisation des signaux POSIX "
                               "impossible\n");
                   }
                   else
                   {
                       printf("+++System : Initialization of POSIX signals "
                               "failed\n");
                   }
   
                   return(EXIT_FAILURE);
               }
   
               signal_test = SIGTEST;
               raise(SIGSEGV);
   
               attente.tv_sec = 0;
               attente.tv_nsec = 1000000;
   
               for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
               {
                   nanosleep(&attente, NULL);
               }
   
               if (signal_test != SIGSEGV)
               {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_post(&semaphore_gestionnaires_signaux);
                       sem_destroy(&semaphore_gestionnaires_signaux);
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_post(semaphore_gestionnaires_signaux);
                       sem_destroy2(semaphore_gestionnaires_signaux,
                               getpid(), SEM_SIGNAUX);
                       sem_destroy3((*s_etat_processus).semphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   liberation_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
                   erreur = d_es_signal;
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Initialisation des signaux POSIX "                      printf("+++Système : Initialisation des signaux POSIX "
Line 1575  rplinit(int argc, char *argv[], unsigned Line 2849  rplinit(int argc, char *argv[], unsigned
   
                 return(EXIT_FAILURE);                  return(EXIT_FAILURE);
             }              }
   #   endif
   
               action.sa_handler = interruption3;
               action.sa_flags = 0;
   
             if (sigaction(SIGBUS, &action, NULL) != 0)              if (sigaction(SIGBUS, &action, NULL) != 0)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_post(&semaphore_gestionnaires_signaux);
                       sem_destroy(&semaphore_gestionnaires_signaux);
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_post(semaphore_gestionnaires_signaux);
                       sem_destroy2(semaphore_gestionnaires_signaux,
                               getpid(), SEM_SIGNAUX);
                       sem_destroy3((*s_etat_processus).semphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   liberation_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                   if ((*s_etat_processus).langue == 'F')
                   {
                       printf("+++Système : Initialisation des signaux POSIX "
                               "impossible\n");
                   }
                   else
                   {
                       printf("+++System : Initialization of POSIX signals "
                               "failed\n");
                   }
   
                   return(EXIT_FAILURE);
               }
   
               signal_test = SIGTEST;
               raise(SIGBUS);
   
               attente.tv_sec = 0;
               attente.tv_nsec = 1000000;
   
               for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
               {
                   nanosleep(&attente, NULL);
               }
   
               if (signal_test != SIGBUS)
               {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_post(&semaphore_gestionnaires_signaux);
                       sem_destroy(&semaphore_gestionnaires_signaux);
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_post(semaphore_gestionnaires_signaux);
                       sem_destroy2(semaphore_gestionnaires_signaux,
                               getpid(), SEM_SIGNAUX);
                       sem_destroy3((*s_etat_processus).semphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   liberation_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                   erreur = d_es_signal;
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Initialisation des signaux POSIX "                      printf("+++Système : Initialisation des signaux POSIX "
Line 1591  rplinit(int argc, char *argv[], unsigned Line 2956  rplinit(int argc, char *argv[], unsigned
   
                 return(EXIT_FAILURE);                  return(EXIT_FAILURE);
             }              }
   
         }          }
   
         if (option_n == d_vrai)          if (option_n == d_vrai)
         {          {
 #           ifndef _BROKEN_SIGINFO              action.sa_handler = interruption4;
             action.sa_sigaction = interruption10;              action.sa_flags = 0;
 #           else  
             action.sa_handler = interruption10;  
 #           endif  
             action.sa_flags = SA_ONSTACK | SA_SIGINFO;  
   
             if (sigaction(SIGHUP, &action, NULL) != 0)              if (sigaction(SIGHUP, &action, NULL) != 0)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_post(&semaphore_gestionnaires_signaux);
                       sem_destroy(&semaphore_gestionnaires_signaux);
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_post(semaphore_gestionnaires_signaux);
                       sem_destroy2(semaphore_gestionnaires_signaux,
                               getpid(), SEM_SIGNAUX);
                       sem_destroy3((*s_etat_processus).semphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   liberation_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Initialisation des signaux POSIX "                      printf("+++Système : Initialisation des signaux POSIX "
Line 1646  rplinit(int argc, char *argv[], unsigned Line 3037  rplinit(int argc, char *argv[], unsigned
                     creation_nom_fichier(s_etat_processus, (*s_etat_processus)                      creation_nom_fichier(s_etat_processus, (*s_etat_processus)
                     .chemin_fichiers_temporaires)) == NULL)                      .chemin_fichiers_temporaires)) == NULL)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_post(&semaphore_gestionnaires_signaux);
                       sem_destroy(&semaphore_gestionnaires_signaux);
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_post(semaphore_gestionnaires_signaux);
                       sem_destroy2(semaphore_gestionnaires_signaux,
                               getpid(), SEM_SIGNAUX);
                       sem_destroy3((*s_etat_processus).semphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   liberation_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Fichier indisponible\n");                      printf("+++Système : Fichier indisponible\n");
Line 1661  rplinit(int argc, char *argv[], unsigned Line 3081  rplinit(int argc, char *argv[], unsigned
             if ((f_source = fopen(nom_fichier_temporaire, "w"))              if ((f_source = fopen(nom_fichier_temporaire, "w"))
                     == NULL)                      == NULL)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_post(&semaphore_gestionnaires_signaux);
                       sem_destroy(&semaphore_gestionnaires_signaux);
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_post(semaphore_gestionnaires_signaux);
                       sem_destroy2(semaphore_gestionnaires_signaux,
                               getpid(), SEM_SIGNAUX);
                       sem_destroy3((*s_etat_processus).semphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   liberation_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Fichier introuvable\n");                      printf("+++Système : Fichier introuvable\n");
Line 1675  rplinit(int argc, char *argv[], unsigned Line 3124  rplinit(int argc, char *argv[], unsigned
   
             if (fprintf(f_source, "MODE_INTERACTIF\n") < 0)              if (fprintf(f_source, "MODE_INTERACTIF\n") < 0)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_post(&semaphore_gestionnaires_signaux);
                       sem_destroy(&semaphore_gestionnaires_signaux);
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_post(semaphore_gestionnaires_signaux);
                       sem_destroy2(semaphore_gestionnaires_signaux,
                               getpid(), SEM_SIGNAUX);
                       sem_destroy3((*s_etat_processus).semphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   liberation_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Erreur d'écriture dans un fichier\n");                      printf("+++Système : Erreur d'écriture dans un fichier\n");
Line 1690  rplinit(int argc, char *argv[], unsigned Line 3168  rplinit(int argc, char *argv[], unsigned
             if (fprintf(f_source,              if (fprintf(f_source,
                     "<< DO HALT UNTIL FALSE END >>\n") < 0)                      "<< DO HALT UNTIL FALSE END >>\n") < 0)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_post(&semaphore_gestionnaires_signaux);
                       sem_destroy(&semaphore_gestionnaires_signaux);
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_post(semaphore_gestionnaires_signaux);
                       sem_destroy2(semaphore_gestionnaires_signaux,
                               getpid(), SEM_SIGNAUX);
                       sem_destroy3((*s_etat_processus).semphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   liberation_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Erreur d'écriture dans un fichier\n");                      printf("+++Système : Erreur d'écriture dans un fichier\n");
Line 1704  rplinit(int argc, char *argv[], unsigned Line 3211  rplinit(int argc, char *argv[], unsigned
   
             if (fclose(f_source) != 0)              if (fclose(f_source) != 0)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_post(&semaphore_gestionnaires_signaux);
                       sem_destroy(&semaphore_gestionnaires_signaux);
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_post(semaphore_gestionnaires_signaux);
                       sem_destroy2(semaphore_gestionnaires_signaux,
                               getpid(), SEM_SIGNAUX);
                       sem_destroy3((*s_etat_processus).semphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   liberation_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Fichier indisponible\n");                      printf("+++Système : Fichier indisponible\n");
Line 1741  rplinit(int argc, char *argv[], unsigned Line 3277  rplinit(int argc, char *argv[], unsigned
         if (((existence == d_faux) || (erreur_fichier != d_absence_erreur)) &&          if (((existence == d_faux) || (erreur_fichier != d_absence_erreur)) &&
                 (option_S == d_faux))                  (option_S == d_faux))
         {          {
   #           ifndef SEMAPHORES_NOMMES
                   sem_post(&((*s_etat_processus).semaphore_fork));
                   sem_post(&semaphore_gestionnaires_signaux);
                   sem_destroy(&semaphore_gestionnaires_signaux);
                   sem_destroy(&((*s_etat_processus).semaphore_fork));
   #           else
                   sem_post((*s_etat_processus).semaphore_fork);
                   sem_post(semaphore_gestionnaires_signaux);
                   sem_destroy2(semaphore_gestionnaires_signaux,
                           getpid(), SEM_SIGNAUX);
                   sem_destroy3((*s_etat_processus).semphore_fork,
                           getpid(), pthread_self(), SEM_FORK);
   #           endif
   
               liberation_contexte_cas(s_etat_processus);
               liberation_queue_signaux(s_etat_processus);
   
   #           ifdef HAVE_STACK_OVERFLOW_RECOVERY
                   stackoverflow_deinstall_handler();
   #           endif
   
   #           ifdef HAVE_SIGSEGV_RECOVERY
                   if (debug == d_faux)
                   {
                       sigsegv_deinstall_handler();
                   }
   #           endif
   
             if (presence_definition == 'O')              if (presence_definition == 'O')
             {              {
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
Line 1773  rplinit(int argc, char *argv[], unsigned Line 3337  rplinit(int argc, char *argv[], unsigned
   
         if ((*s_etat_processus).chemin_fichiers_temporaires == NULL)          if ((*s_etat_processus).chemin_fichiers_temporaires == NULL)
         {          {
   #           ifndef SEMAPHORES_NOMMES
                   sem_post(&((*s_etat_processus).semaphore_fork));
                   sem_post(&semaphore_gestionnaires_signaux);
                   sem_destroy(&semaphore_gestionnaires_signaux);
                   sem_destroy(&((*s_etat_processus).semaphore_fork));
   #           else
                   sem_post((*s_etat_processus).semaphore_fork);
                   sem_post(semaphore_gestionnaires_signaux);
                   sem_destroy2(semaphore_gestionnaires_signaux,
                           getpid(), SEM_SIGNAUX);
                   sem_destroy3((*s_etat_processus).semphore_fork,
                           getpid(), pthread_self(), SEM_FORK);
   #           endif
   
               liberation_contexte_cas(s_etat_processus);
               liberation_queue_signaux(s_etat_processus);
   
   #           ifdef HAVE_STACK_OVERFLOW_RECOVERY
                   stackoverflow_deinstall_handler();
   #           endif
   
   #           ifdef HAVE_SIGSEGV_RECOVERY
                   if (debug == d_faux)
                   {
                       sigsegv_deinstall_handler();
                   }
   #           endif
   
             if ((*s_etat_processus).langue == 'F')              if ((*s_etat_processus).langue == 'F')
             {              {
                 printf("+++Système : Chemin des fichiers temporaires nul\n");                  printf("+++Système : Chemin des fichiers temporaires nul\n");
Line 1810  rplinit(int argc, char *argv[], unsigned Line 3402  rplinit(int argc, char *argv[], unsigned
             gettimeofday(&((*s_etat_processus).horodatage_profilage), NULL);              gettimeofday(&((*s_etat_processus).horodatage_profilage), NULL);
   
             (*s_etat_processus).liste_mutexes = NULL;              (*s_etat_processus).liste_mutexes = NULL;
               (*s_etat_processus).sections_critiques = 0;
   
             (*s_etat_processus).test_instruction = 'N';              (*s_etat_processus).test_instruction = 'N';
             (*s_etat_processus).nombre_arguments = 0;              (*s_etat_processus).nombre_arguments = 0;
             (*s_etat_processus).affichage_arguments = 'N';              (*s_etat_processus).affichage_arguments = 'N';
             (*s_etat_processus).autorisation_conversion_chaine = 'Y';              (*s_etat_processus).autorisation_conversion_chaine = 'Y';
             (*s_etat_processus).autorisation_evaluation_nom = 'Y';              (*s_etat_processus).autorisation_evaluation_nom = 'Y';
             (*s_etat_processus).autorisation_nom_implicite = 'Y';  
               if (mode_interactif == d_vrai)
               {
                   (*s_etat_processus).autorisation_nom_implicite = 'Y';
               }
               else
               {
                   (*s_etat_processus).autorisation_nom_implicite = 'N';
               }
   
             (*s_etat_processus).autorisation_empilement_programme = 'N';              (*s_etat_processus).autorisation_empilement_programme = 'N';
             (*s_etat_processus).requete_arret = 'N';              (*s_etat_processus).requete_arret = 'N';
             (*s_etat_processus).evaluation_forcee = 'N';              (*s_etat_processus).evaluation_forcee = 'N';
               (*s_etat_processus).recherche_type = 'N';
   
             (*s_etat_processus).constante_symbolique = 'N';              (*s_etat_processus).constante_symbolique = 'N';
             (*s_etat_processus).traitement_symbolique = 'N';              (*s_etat_processus).traitement_symbolique = 'N';
Line 1831  rplinit(int argc, char *argv[], unsigned Line 3434  rplinit(int argc, char *argv[], unsigned
             (*s_etat_processus).l_base_pile = NULL;              (*s_etat_processus).l_base_pile = NULL;
             (*s_etat_processus).l_base_pile_last = NULL;              (*s_etat_processus).l_base_pile_last = NULL;
   
             (*s_etat_processus).s_liste_variables = NULL;              (*s_etat_processus).s_arbre_variables = NULL;
               (*s_etat_processus).l_liste_variables_par_niveau = NULL;
               (*s_etat_processus).l_liste_variables_statiques = NULL;
             (*s_etat_processus).gel_liste_variables = d_faux;              (*s_etat_processus).gel_liste_variables = d_faux;
             (*s_etat_processus).nombre_variables = 0;              s_arbre_variables_partagees = NULL;
             (*s_etat_processus).nombre_variables_allouees = 0;              l_liste_variables_partagees = NULL;
             (*s_etat_processus).s_liste_variables_statiques = NULL;              (*s_etat_processus).s_arbre_variables_partagees =
             (*s_etat_processus).nombre_variables_statiques = 0;                      &s_arbre_variables_partagees;
             (*s_etat_processus).nombre_variables_statiques_allouees = 0;              (*s_etat_processus).l_liste_variables_partagees =
                       &l_liste_variables_partagees;
               (*s_etat_processus).pointeur_variable_courante = NULL;
               (*s_etat_processus).pointeur_variable_statique_courante = NULL;
               (*s_etat_processus).pointeur_variable_partagee_courante = NULL;
             (*s_etat_processus).niveau_courant = 0;              (*s_etat_processus).niveau_courant = 0;
             (*s_etat_processus).niveau_initial = 0;              (*s_etat_processus).niveau_initial = 0;
             (*s_etat_processus).creation_variables_statiques = d_faux;              (*s_etat_processus).creation_variables_statiques = d_faux;
             (*s_etat_processus).creation_variables_partagees = d_faux;              (*s_etat_processus).creation_variables_partagees = d_faux;
             (*s_etat_processus).position_variable_courante = 0;  
             (*s_etat_processus).position_variable_statique_courante = 0;  
   
             (*s_etat_processus).s_bibliotheques = NULL;              (*s_etat_processus).s_bibliotheques = NULL;
             (*s_etat_processus).s_instructions_externes = NULL;              (*s_etat_processus).s_instructions_externes = NULL;
Line 1972  rplinit(int argc, char *argv[], unsigned Line 3579  rplinit(int argc, char *argv[], unsigned
             (*s_etat_processus).arbre_instructions = NULL;              (*s_etat_processus).arbre_instructions = NULL;
   
             (*s_etat_processus).tid_processus_pere = pthread_self();              (*s_etat_processus).tid_processus_pere = pthread_self();
               (*s_etat_processus).tid = pthread_self();
             (*s_etat_processus).pid_processus_pere = getpid();              (*s_etat_processus).pid_processus_pere = getpid();
             (*s_etat_processus).processus_detache = d_vrai;              (*s_etat_processus).processus_detache = d_vrai;
             (*s_etat_processus).var_volatile_processus_pere = -1;              (*s_etat_processus).var_volatile_processus_pere = -1;
Line 1985  rplinit(int argc, char *argv[], unsigned Line 3593  rplinit(int argc, char *argv[], unsigned
             (*s_etat_processus).var_volatile_recursivite = 0;              (*s_etat_processus).var_volatile_recursivite = 0;
             (*s_etat_processus).var_volatile_exception_gsl = 0;              (*s_etat_processus).var_volatile_exception_gsl = 0;
             (*s_etat_processus).arret_depuis_abort = 0;              (*s_etat_processus).arret_depuis_abort = 0;
               (*s_etat_processus).pointeur_signal_lecture = 0;
               (*s_etat_processus).pointeur_signal_ecriture = 0;
   
             initialisation_allocateur(s_etat_processus);              initialisation_allocateur(s_etat_processus);
             initialisation_drapeaux(s_etat_processus);              initialisation_drapeaux(s_etat_processus);
               initialisation_variables(s_etat_processus);
               initialisation_instructions(s_etat_processus);
   
             if ((*s_etat_processus).erreur_systeme != d_es)              if ((*s_etat_processus).erreur_systeme != d_es)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_post(&semaphore_gestionnaires_signaux);
                       sem_destroy(&semaphore_gestionnaires_signaux);
                       sem_destroy(&((*s_etat_processus).semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_post(semaphore_gestionnaires_signaux);
                       sem_destroy2(semaphore_gestionnaires_signaux,
                               getpid(), SEM_SIGNAUX);
                       sem_destroy3((*s_etat_processus).semphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   liberation_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Mémoire insuffisante\n");                      printf("+++Système : Mémoire insuffisante\n");
Line 2006  rplinit(int argc, char *argv[], unsigned Line 3646  rplinit(int argc, char *argv[], unsigned
             if (((*s_etat_processus).instruction_derniere_erreur =              if (((*s_etat_processus).instruction_derniere_erreur =
                     malloc(sizeof(unsigned char))) == NULL)                      malloc(sizeof(unsigned char))) == NULL)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_post(&semaphore_gestionnaires_signaux);
                       sem_destroy(&semaphore_gestionnaires_signaux);
                       sem_destroy(&((*s_etat_processus).semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_post(semaphore_gestionnaires_signaux);
                       sem_destroy2(semaphore_gestionnaires_signaux,
                               getpid(), SEM_SIGNAUX);
                       sem_destroy3((*s_etat_processus).semphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   liberation_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 erreur = d_es_allocation_memoire;                  erreur = d_es_allocation_memoire;
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
Line 2035  rplinit(int argc, char *argv[], unsigned Line 3703  rplinit(int argc, char *argv[], unsigned
             if (((*s_etat_processus).instruction_courante = (unsigned char *)              if (((*s_etat_processus).instruction_courante = (unsigned char *)
                     malloc(sizeof(unsigned char))) == NULL)                      malloc(sizeof(unsigned char))) == NULL)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_post(&semaphore_gestionnaires_signaux);
                       sem_destroy(&semaphore_gestionnaires_signaux);
                       sem_destroy(&((*s_etat_processus).semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_post(semaphore_gestionnaires_signaux);
                       sem_destroy2(semaphore_gestionnaires_signaux,
                               getpid(), SEM_SIGNAUX);
                       sem_destroy3((*s_etat_processus).semphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   liberation_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 erreur = d_es_allocation_memoire;                  erreur = d_es_allocation_memoire;
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
Line 2064  rplinit(int argc, char *argv[], unsigned Line 3760  rplinit(int argc, char *argv[], unsigned
                 (*((*s_etat_processus).l_base_pile_systeme))                  (*((*s_etat_processus).l_base_pile_systeme))
                         .retour_definition = 'Y';                          .retour_definition = 'Y';
   
                 (*s_etat_processus).indep = (struct_objet *) malloc(                  (*s_etat_processus).indep = allocation(s_etat_processus, NON);
                         sizeof(struct_objet));                  (*s_etat_processus).depend = allocation(s_etat_processus, NON);
                 (*s_etat_processus).depend = (struct_objet *) malloc(  
                         sizeof(struct_objet));  
                 (*s_etat_processus).parametres_courbes_de_niveau =                  (*s_etat_processus).parametres_courbes_de_niveau =
                         (struct_objet *) malloc(sizeof(struct_objet));                          allocation(s_etat_processus, NON);
   
                 if (((*s_etat_processus).indep != NULL) &&                  if (((*s_etat_processus).indep != NULL) &&
                         ((*s_etat_processus).depend != NULL) &&                          ((*s_etat_processus).depend != NULL) &&
Line 2099  rplinit(int argc, char *argv[], unsigned Line 3793  rplinit(int argc, char *argv[], unsigned
                             ((*((*s_etat_processus).                              ((*((*s_etat_processus).
                             parametres_courbes_de_niveau)).objet == NULL))                              parametres_courbes_de_niveau)).objet == NULL))
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_post(&semaphore_gestionnaires_signaux);
                               sem_destroy(&semaphore_gestionnaires_signaux);
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_post(semaphore_gestionnaires_signaux);
                               sem_destroy2(semaphore_gestionnaires_signaux,
                                       getpid(), SEM_SIGNAUX);
                               sem_destroy3((*s_etat_processus).semphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           liberation_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         erreur = d_es_allocation_memoire;                          erreur = d_es_allocation_memoire;
                                                   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
Line 2123  rplinit(int argc, char *argv[], unsigned Line 3845  rplinit(int argc, char *argv[], unsigned
                             (*((*s_etat_processus).depend)).objet)).nom ==                              (*((*s_etat_processus).depend)).objet)).nom ==
                             NULL))                              NULL))
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_post(&semaphore_gestionnaires_signaux);
                               sem_destroy(&semaphore_gestionnaires_signaux);
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_post(semaphore_gestionnaires_signaux);
                               sem_destroy2(semaphore_gestionnaires_signaux,
                                       getpid(), SEM_SIGNAUX);
                               sem_destroy3((*s_etat_processus).semphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           liberation_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         erreur = d_es_allocation_memoire;                          erreur = d_es_allocation_memoire;
   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
Line 2175  rplinit(int argc, char *argv[], unsigned Line 3925  rplinit(int argc, char *argv[], unsigned
                             .parametres_courbes_de_niveau)).objet)).donnee                              .parametres_courbes_de_niveau)).objet)).donnee
                             == NULL))                              == NULL))
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_post(&semaphore_gestionnaires_signaux);
                               sem_destroy(&semaphore_gestionnaires_signaux);
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_post(semaphore_gestionnaires_signaux);
                               sem_destroy2(semaphore_gestionnaires_signaux,
                                       getpid(), SEM_SIGNAUX);
                               sem_destroy3((*s_etat_processus).semphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           liberation_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         erreur = d_es_allocation_memoire;                          erreur = d_es_allocation_memoire;
   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
Line 2203  rplinit(int argc, char *argv[], unsigned Line 3981  rplinit(int argc, char *argv[], unsigned
                             .objet = malloc(10 * sizeof(unsigned char)))                              .objet = malloc(10 * sizeof(unsigned char)))
                             == NULL)                              == NULL)
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_post(&semaphore_gestionnaires_signaux);
                               sem_destroy(&semaphore_gestionnaires_signaux);
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_post(semaphore_gestionnaires_signaux);
                               sem_destroy2(semaphore_gestionnaires_signaux,
                                       getpid(), SEM_SIGNAUX);
                               sem_destroy3((*s_etat_processus).semphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           liberation_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         erreur = d_es_allocation_memoire;                          erreur = d_es_allocation_memoire;
   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
Line 2263  rplinit(int argc, char *argv[], unsigned Line 4069  rplinit(int argc, char *argv[], unsigned
                     (*s_etat_processus).my2_lines = d_faux;                      (*s_etat_processus).my2_lines = d_faux;
                     (*s_etat_processus).mz2_lines = d_faux;                      (*s_etat_processus).mz2_lines = d_faux;
   
                     if ((*s_etat_processus).erreur_systeme != d_es)  
                     {  
                         if ((*s_etat_processus).langue == 'F')  
                         {  
                             printf("+++Système : Mémoire insuffisante\n");  
                         }  
                         else  
                         {  
                             printf("+++System : Not enough memory\n");  
                         }  
   
                         return(EXIT_FAILURE);  
                     }  
   
                     (*s_etat_processus).mode_evaluation_expression = 'N';                      (*s_etat_processus).mode_evaluation_expression = 'N';
                     (*s_etat_processus).mode_execution_programme = 'Y';                      (*s_etat_processus).mode_execution_programme = 'Y';
   
Line 2285  rplinit(int argc, char *argv[], unsigned Line 4077  rplinit(int argc, char *argv[], unsigned
                         if ((erreur = chainage(s_etat_processus)) !=                          if ((erreur = chainage(s_etat_processus)) !=
                                 d_absence_erreur)                                  d_absence_erreur)
                         {                          {
   #                           ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                           else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                           endif
   
                               liberation_contexte_cas(s_etat_processus);
                               liberation_queue_signaux(s_etat_processus);
   
   #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                           endif
   
   #                           ifdef HAVE_SIGSEGV_RECOVERY
                                   if (debug == d_faux)
                                   {
                                       sigsegv_deinstall_handler();
                                   }
   #                           endif
   
                             if ((*s_etat_processus).langue == 'F')                              if ((*s_etat_processus).langue == 'F')
                             {                              {
                                 printf("+++Fatal :"                                  printf("+++Fatal :"
Line 2316  rplinit(int argc, char *argv[], unsigned Line 4137  rplinit(int argc, char *argv[], unsigned
                     if ((erreur = compilation(s_etat_processus)) !=                      if ((erreur = compilation(s_etat_processus)) !=
                             d_absence_erreur)                              d_absence_erreur)
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_post(&semaphore_gestionnaires_signaux);
                               sem_destroy(&semaphore_gestionnaires_signaux);
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_post(semaphore_gestionnaires_signaux);
                               sem_destroy2(semaphore_gestionnaires_signaux,
                                       getpid(), SEM_SIGNAUX);
                               sem_destroy3((*s_etat_processus).semphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           liberation_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         if (traitement_fichier_temporaire == 'Y')                          if (traitement_fichier_temporaire == 'Y')
                         {                          {
                             if (destruction_fichier(nom_fichier_temporaire)                              if (destruction_fichier(nom_fichier_temporaire)
Line 2373  rplinit(int argc, char *argv[], unsigned Line 4222  rplinit(int argc, char *argv[], unsigned
                     (*s_etat_processus).position_courante = 0;                      (*s_etat_processus).position_courante = 0;
                     (*s_etat_processus).traitement_cycle_exit = 'N';                      (*s_etat_processus).traitement_cycle_exit = 'N';
   
                     if ((*s_etat_processus).nombre_variables == 0)                      if ((*s_etat_processus).s_arbre_variables == NULL)
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_post(&semaphore_gestionnaires_signaux);
                               sem_destroy(&semaphore_gestionnaires_signaux);
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_post(semaphore_gestionnaires_signaux);
                               sem_destroy2(semaphore_gestionnaires_signaux,
                                       getpid(), SEM_SIGNAUX);
                               sem_destroy3((*s_etat_processus).semphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           liberation_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
                         {                          {
                             printf("+++Fatal : Aucun point d'entrée\n");                              printf("+++Fatal : Aucun point d'entrée\n");
Line 2395  rplinit(int argc, char *argv[], unsigned Line 4272  rplinit(int argc, char *argv[], unsigned
                     if (recherche_instruction_suivante(s_etat_processus)                      if (recherche_instruction_suivante(s_etat_processus)
                             == d_erreur)                              == d_erreur)
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_post(&semaphore_gestionnaires_signaux);
                               sem_destroy(&semaphore_gestionnaires_signaux);
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_post(semaphore_gestionnaires_signaux);
                               sem_destroy2(semaphore_gestionnaires_signaux,
                                       getpid(), SEM_SIGNAUX);
                               sem_destroy3((*s_etat_processus).semphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           liberation_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
                         {                          {
                             printf("+++Fatal : Aucun point d'entrée\n");                              printf("+++Fatal : Aucun point d'entrée\n");
Line 2416  rplinit(int argc, char *argv[], unsigned Line 4321  rplinit(int argc, char *argv[], unsigned
                             (*s_etat_processus)                              (*s_etat_processus)
                             .instruction_courante) == d_faux)                              .instruction_courante) == d_faux)
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_post(&semaphore_gestionnaires_signaux);
                               sem_destroy(&semaphore_gestionnaires_signaux);
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_post(semaphore_gestionnaires_signaux);
                               sem_destroy2(semaphore_gestionnaires_signaux,
                                       getpid(), SEM_SIGNAUX);
                               sem_destroy3((*s_etat_processus).semphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           liberation_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
                         {                          {
                             printf("+++Fatal : Aucun point d'entrée\n");                              printf("+++Fatal : Aucun point d'entrée\n");
Line 2433  rplinit(int argc, char *argv[], unsigned Line 4366  rplinit(int argc, char *argv[], unsigned
                         return(EXIT_FAILURE);                          return(EXIT_FAILURE);
                     }                      }
   
                     if ((*s_etat_processus).s_liste_variables                      if ((*(*s_etat_processus).pointeur_variable_courante)
                             [(*s_etat_processus)                              .niveau != 0)
                             .position_variable_courante].niveau != 0)  
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_post(&semaphore_gestionnaires_signaux);
                               sem_destroy(&semaphore_gestionnaires_signaux);
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_post(semaphore_gestionnaires_signaux);
                               sem_destroy2(semaphore_gestionnaires_signaux,
                                       getpid(), SEM_SIGNAUX);
                               sem_destroy3((*s_etat_processus).semphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           liberation_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
                         {                          {
                             printf("+++Fatal : Aucun point d'entrée\n");                              printf("+++Fatal : Aucun point d'entrée\n");
Line 2462  rplinit(int argc, char *argv[], unsigned Line 4422  rplinit(int argc, char *argv[], unsigned
                             strlen(ds_fichier_historique) + 2) *                              strlen(ds_fichier_historique) + 2) *
                             sizeof(unsigned char))) == NULL)                              sizeof(unsigned char))) == NULL)
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_post(&semaphore_gestionnaires_signaux);
                               sem_destroy(&semaphore_gestionnaires_signaux);
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_post(semaphore_gestionnaires_signaux);
                               sem_destroy2(semaphore_gestionnaires_signaux,
                                       getpid(), SEM_SIGNAUX);
                               sem_destroy3((*s_etat_processus).semphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           liberation_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         erreur = d_es_allocation_memoire;                          erreur = d_es_allocation_memoire;
   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
Line 2480  rplinit(int argc, char *argv[], unsigned Line 4468  rplinit(int argc, char *argv[], unsigned
                             home, ds_fichier_historique);                              home, ds_fichier_historique);
   
                     using_history();                      using_history();
   
                       // Pour pouvoir utiliser le keymap avant le premier
                       // appel à readline().
                       rl_initialize();
   
                     erreur_historique = read_history(                      erreur_historique = read_history(
                             (*s_etat_processus).nom_fichier_historique);                              (*s_etat_processus).nom_fichier_historique);
   
Line 2496  rplinit(int argc, char *argv[], unsigned Line 4489  rplinit(int argc, char *argv[], unsigned
                             if ((message = messages(s_etat_processus))                              if ((message = messages(s_etat_processus))
                                     == NULL)                                      == NULL)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_post(&semaphore_gestionnaires_signaux);
                                       sem_destroy(
                                               &semaphore_gestionnaires_signaux);
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                               else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_post(semaphore_gestionnaires_signaux);
                                       sem_destroy2(
                                               semaphore_gestionnaires_signaux,
                                               getpid(), SEM_SIGNAUX);
                                       sem_destroy3((*s_etat_processus)
                                               .semphore_fork,
                                               getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                               endif
   
   #                               ifdef HAVE_SIGSEGV_RECOVERY
                                       if (debug == d_faux)
                                       {
                                           sigsegv_deinstall_handler();
                                       }
   #                               endif
   
                                 erreur = d_es_allocation_memoire;                                  erreur = d_es_allocation_memoire;
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
Line 2521  rplinit(int argc, char *argv[], unsigned Line 4548  rplinit(int argc, char *argv[], unsigned
   
                     fflush(stdout);                      fflush(stdout);
   
                     initialisation_instructions(s_etat_processus);  
   
                     if (arguments != NULL)                      if (arguments != NULL)
                     {                      {
                         tampon = (*s_etat_processus).definitions_chainees;                          tampon = (*s_etat_processus).definitions_chainees;
Line 2534  rplinit(int argc, char *argv[], unsigned Line 4559  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if ((*s_etat_processus).erreur_systeme != d_es)                              if ((*s_etat_processus).erreur_systeme != d_es)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_post(&semaphore_gestionnaires_signaux);
                                       sem_destroy(
                                               &semaphore_gestionnaires_signaux);
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                               else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_post(semaphore_gestionnaires_signaux);
                                       sem_destroy2(
                                               semaphore_gestionnaires_signaux,
                                               getpid(), SEM_SIGNAUX);
                                       sem_destroy3((*s_etat_processus)
                                               .semphore_fork,
                                               getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                               endif
   
   #                               ifdef HAVE_SIGSEGV_RECOVERY
                                       if (debug == d_faux)
                                       {
                                           sigsegv_deinstall_handler();
                                       }
   #                               endif
   
                                 erreur = d_es_allocation_memoire;                                  erreur = d_es_allocation_memoire;
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
Line 2551  rplinit(int argc, char *argv[], unsigned Line 4610  rplinit(int argc, char *argv[], unsigned
                             }                              }
                             else                              else
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_post(&semaphore_gestionnaires_signaux);
                                       sem_destroy(
                                               &semaphore_gestionnaires_signaux);
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                               else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_post(semaphore_gestionnaires_signaux);
                                       sem_destroy2(
                                               semaphore_gestionnaires_signaux,
                                               getpid(), SEM_SIGNAUX);
                                       sem_destroy3((*s_etat_processus)
                                               .semphore_fork,
                                               getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                               endif
   
   #                               ifdef HAVE_SIGSEGV_RECOVERY
                                       if (debug == d_faux)
                                       {
                                           sigsegv_deinstall_handler();
                                       }
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : Erreur de "                                      printf("+++Erreur : Erreur de "
Line 2574  rplinit(int argc, char *argv[], unsigned Line 4667  rplinit(int argc, char *argv[], unsigned
   
                         if ((*s_etat_processus).erreur_systeme != d_es)                          if ((*s_etat_processus).erreur_systeme != d_es)
                         {                          {
   #                           ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                           else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                           endif
   
                               liberation_contexte_cas(s_etat_processus);
                               liberation_queue_signaux(s_etat_processus);
   
   #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                           endif
   
   #                           ifdef HAVE_SIGSEGV_RECOVERY
                                   if (debug == d_faux)
                                   {
                                       sigsegv_deinstall_handler();
                                   }
   #                           endif
   
                             if ((message = messages(s_etat_processus))                              if ((message = messages(s_etat_processus))
                                     == NULL)                                      == NULL)
                             {                              {
Line 2604  rplinit(int argc, char *argv[], unsigned Line 4726  rplinit(int argc, char *argv[], unsigned
                             if ((message = messages(s_etat_processus))                              if ((message = messages(s_etat_processus))
                                     == NULL)                                      == NULL)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_post(&semaphore_gestionnaires_signaux);
                                       sem_destroy(
                                               &semaphore_gestionnaires_signaux);
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                               else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_post(semaphore_gestionnaires_signaux);
                                       sem_destroy2(
                                               semaphore_gestionnaires_signaux,
                                               getpid(), SEM_SIGNAUX);
                                       sem_destroy3((*s_etat_processus)
                                               .semphore_fork,
                                               getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                               endif
   
   #                               ifdef HAVE_SIGSEGV_RECOVERY
                                       if (debug == d_faux)
                                       {
                                           sigsegv_deinstall_handler();
                                       }
   #                               endif
   
                                 erreur = d_es_allocation_memoire;                                  erreur = d_es_allocation_memoire;
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
Line 2623  rplinit(int argc, char *argv[], unsigned Line 4779  rplinit(int argc, char *argv[], unsigned
                             printf("%s [%d]\n", message, (int) getpid());                              printf("%s [%d]\n", message, (int) getpid());
                             free(message);                              free(message);
   
   #                           ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                           else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                           endif
   
                               liberation_contexte_cas(s_etat_processus);
                               liberation_queue_signaux(s_etat_processus);
   
   #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                           endif
   
   #                           ifdef HAVE_SIGSEGV_RECOVERY
                                   if (debug == d_faux)
                                   {
                                       sigsegv_deinstall_handler();
                                   }
   #                           endif
   
                             return(EXIT_FAILURE);                              return(EXIT_FAILURE);
                         }                          }
   
Line 2633  rplinit(int argc, char *argv[], unsigned Line 4818  rplinit(int argc, char *argv[], unsigned
                             if ((message = messages(s_etat_processus))                              if ((message = messages(s_etat_processus))
                                     == NULL)                                      == NULL)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_post(&semaphore_gestionnaires_signaux);
                                       sem_destroy(
                                               &semaphore_gestionnaires_signaux);
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                               else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_post(semaphore_gestionnaires_signaux);
                                       sem_destroy2(
                                               semaphore_gestionnaires_signaux,
                                               getpid(), SEM_SIGNAUX);
                                       sem_destroy3((*s_etat_processus)
                                               .semphore_fork,
                                               getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                               endif
   
   #                               ifdef HAVE_SIGSEGV_RECOVERY
                                       if (debug == d_faux)
                                       {
                                           sigsegv_deinstall_handler();
                                       }
   #                               endif
   
                                   erreur = d_es_allocation_memoire;
                                 erreur = d_es_allocation_memoire;                                  erreur = d_es_allocation_memoire;
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
Line 2652  rplinit(int argc, char *argv[], unsigned Line 4872  rplinit(int argc, char *argv[], unsigned
                             printf("%s [%d]\n", message, (int) getpid());                              printf("%s [%d]\n", message, (int) getpid());
                             free(message);                              free(message);
   
   #                           ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_post(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&semaphore_gestionnaires_signaux);
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                           else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_post(semaphore_gestionnaires_signaux);
                                   sem_destroy2(semaphore_gestionnaires_signaux,
                                           getpid(), SEM_SIGNAUX);
                                   sem_destroy3((*s_etat_processus).semphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                           endif
   
                               liberation_contexte_cas(s_etat_processus);
                               liberation_queue_signaux(s_etat_processus);
   
   #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                           endif
   
   #                           ifdef HAVE_SIGSEGV_RECOVERY
                                   if (debug == d_faux)
                                   {
                                       sigsegv_deinstall_handler();
                                   }
   #                           endif
   
                             return(EXIT_FAILURE);                              return(EXIT_FAILURE);
                         }                          }
   
Line 2663  rplinit(int argc, char *argv[], unsigned Line 4912  rplinit(int argc, char *argv[], unsigned
                                 if ((message = messages(s_etat_processus))                                  if ((message = messages(s_etat_processus))
                                         == NULL)                                          == NULL)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                           sem_post(&((*s_etat_processus)
                                                   .semaphore_fork));
                                           sem_post(
                                                   &semaphore_gestionnaires_signaux
                                                   );
                                           sem_destroy(
                                                   &semaphore_gestionnaires_signaux
                                                   );
                                           sem_destroy(&((*s_etat_processus)
                                                   .semaphore_fork));
   #                                   else
                                           sem_post((*s_etat_processus)
                                                   .semaphore_fork);
                                           sem_post(
                                                   semaphore_gestionnaires_signaux
                                                   );
                                           sem_destroy2(
                                                   semaphore_gestionnaires_signaux,
                                                   getpid(), SEM_SIGNAUX);
                                           sem_destroy3((*s_etat_processus)
                                                   .semphore_fork, getpid(),
                                                   pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       liberation_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                           stackoverflow_deinstall_handler();
   #                                   endif
   
   #                                   ifdef HAVE_SIGSEGV_RECOVERY
                                           if (debug == d_faux)
                                           {
                                               sigsegv_deinstall_handler();
                                           }
   #                                   endif
   
                                     erreur = d_es_allocation_memoire;                                      erreur = d_es_allocation_memoire;
   
                                     if ((*s_etat_processus).langue == 'F')                                      if ((*s_etat_processus).langue == 'F')
Line 2683  rplinit(int argc, char *argv[], unsigned Line 4971  rplinit(int argc, char *argv[], unsigned
                                         (int) getpid());                                          (int) getpid());
                                 free(message);                                  free(message);
   
   #                               ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_post(&semaphore_gestionnaires_signaux);
                                       sem_destroy(
                                               &semaphore_gestionnaires_signaux);
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                               else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_post(semaphore_gestionnaires_signaux);
                                       sem_destroy2(
                                               semaphore_gestionnaires_signaux,
                                               getpid(), SEM_SIGNAUX);
                                       sem_destroy3((*s_etat_processus)
                                               .semphore_fork,
                                               getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                               endif
   
   #                               ifdef HAVE_SIGSEGV_RECOVERY
                                       if (debug == d_faux)
                                       {
                                           sigsegv_deinstall_handler();
                                       }
   #                               endif
   
                                   erreur = d_es_allocation_memoire;
                                 return(EXIT_FAILURE);                                  return(EXIT_FAILURE);
                             }                              }
   
Line 2692  rplinit(int argc, char *argv[], unsigned Line 5015  rplinit(int argc, char *argv[], unsigned
                                 if ((message = messages(s_etat_processus))                                  if ((message = messages(s_etat_processus))
                                         == NULL)                                          == NULL)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                           sem_post(&((*s_etat_processus)
                                                   .semaphore_fork));
                                           sem_post(
                                                   &semaphore_gestionnaires_signaux
                                                   );
                                           sem_destroy(
                                                   &semaphore_gestionnaires_signaux
                                                   );
                                           sem_destroy(&((*s_etat_processus)
                                                   .semaphore_fork));
   #                                   else
                                           sem_post((*s_etat_processus)
                                                   .semaphore_fork);
                                           sem_post(
                                                   semaphore_gestionnaires_signaux
                                                   );
                                           sem_destroy2(
                                                   semaphore_gestionnaires_signaux,
                                                   getpid(), SEM_SIGNAUX);
                                           sem_destroy3((*s_etat_processus)
                                                   .semphore_fork, getpid(),
                                                   pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       liberation_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                           stackoverflow_deinstall_handler();
   #                                   endif
   
   #                                   ifdef HAVE_SIGSEGV_RECOVERY
                                           if (debug == d_faux)
                                           {
                                               sigsegv_deinstall_handler();
                                           }
   #                                   endif
   
                                     erreur = d_es_allocation_memoire;                                      erreur = d_es_allocation_memoire;
   
                                     if ((*s_etat_processus).langue == 'F')                                      if ((*s_etat_processus).langue == 'F')
Line 2712  rplinit(int argc, char *argv[], unsigned Line 5074  rplinit(int argc, char *argv[], unsigned
                                         (int) getpid());                                          (int) getpid());
                                 free(message);                                  free(message);
   
   #                               ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_post(&semaphore_gestionnaires_signaux);
                                       sem_destroy(
                                               &semaphore_gestionnaires_signaux);
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                               else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_post(semaphore_gestionnaires_signaux);
                                       sem_destroy2(
                                               semaphore_gestionnaires_signaux,
                                               getpid(), SEM_SIGNAUX);
                                       sem_destroy3((*s_etat_processus)
                                               .semphore_fork,
                                               getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   liberation_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                               endif
   
   #                               ifdef HAVE_SIGSEGV_RECOVERY
                                       if (debug == d_faux)
                                       {
                                           sigsegv_deinstall_handler();
                                       }
   #                               endif
   
                                 return(EXIT_FAILURE);                                  return(EXIT_FAILURE);
                             }                              }
                         }                          }
Line 2739  rplinit(int argc, char *argv[], unsigned Line 5135  rplinit(int argc, char *argv[], unsigned
                             if (setjmp(contexte_initial) == 0)                              if (setjmp(contexte_initial) == 0)
                             {                              {
                                 erreur = sequenceur(s_etat_processus);                                  erreur = sequenceur(s_etat_processus);
   
                                   if (erreur == d_absence_erreur)
                                   {
                                       if (((*s_etat_processus).var_volatile_alarme
                                               == 0) && ((*s_etat_processus)
                                               .arret_depuis_abort == 0) &&
                                               ((*s_etat_processus).at_exit
                                               != NULL))
                                       {
                                           erreur = evaluation(s_etat_processus,
                                                   (*s_etat_processus).at_exit,
                                                   'E');
                                       }
                                   }
                             }                              }
                         }                          }
                         else                          else
Line 2746  rplinit(int argc, char *argv[], unsigned Line 5156  rplinit(int argc, char *argv[], unsigned
                             if (setjmp(contexte_initial) == 0)                              if (setjmp(contexte_initial) == 0)
                             {                              {
                                 erreur = sequenceur_optimise(s_etat_processus);                                  erreur = sequenceur_optimise(s_etat_processus);
                             }  
                         }  
   
                         if (erreur == d_absence_erreur)                                  if (erreur == d_absence_erreur)
                         {                                  {
                             if (((*s_etat_processus).var_volatile_alarme == 0)                                      if (((*s_etat_processus).var_volatile_alarme
                                     && ((*s_etat_processus).arret_depuis_abort                                              == 0) && ((*s_etat_processus)
                                     == 0) && ((*s_etat_processus).at_exit                                              .arret_depuis_abort == 0) &&
                                     != NULL))                                              ((*s_etat_processus).at_exit
                             {                                              != NULL))
                                 erreur = evaluation(s_etat_processus,                                      {
                                         (*s_etat_processus).at_exit, 'E');                                          erreur = evaluation(s_etat_processus,
                                                   (*s_etat_processus).at_exit,
                                                   'E');
                                       }
                                   }
                             }                              }
                         }                          }
                     }                      }
   
                       for(i = 0; i < (*s_etat_processus).sections_critiques; i++)
                       {
                           pthread_mutex_unlock(&mutex_sections_critiques);
                       }
   
                     liberation(s_etat_processus, (*s_etat_processus).at_exit);                      liberation(s_etat_processus, (*s_etat_processus).at_exit);
                     liberation(s_etat_processus, (*s_etat_processus).at_poke);                      liberation(s_etat_processus, (*s_etat_processus).at_poke);
   
Line 2773  rplinit(int argc, char *argv[], unsigned Line 5190  rplinit(int argc, char *argv[], unsigned
                     l_element_courant = (*s_etat_processus).liste_mutexes;                      l_element_courant = (*s_etat_processus).liste_mutexes;
                     while(l_element_courant != NULL)                      while(l_element_courant != NULL)
                     {                      {
                         pthread_mutex_trylock(&((*((struct_mutex *)  
                                 (*(*((struct_liste_chainee *)  
                                 l_element_courant)).donnee).objet)).mutex));  
                         pthread_mutex_unlock(&((*((struct_mutex *)  
                                 (*(*((struct_liste_chainee *)  
                                 l_element_courant)).donnee).objet)).mutex));  
                         pthread_mutex_destroy(&((*((struct_mutex *)  
                                 (*(*((struct_liste_chainee *)  
                                 l_element_courant)).donnee).objet)).mutex));  
   
                         liberation(s_etat_processus,                          liberation(s_etat_processus,
                                 (*((struct_liste_chainee *)                                  (*((struct_liste_chainee *)
                                 l_element_courant)).donnee);                                  l_element_courant)).donnee);
Line 2874  rplinit(int argc, char *argv[], unsigned Line 5281  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if ((*s_etat_processus).var_volatile_alarme != 0)                              if ((*s_etat_processus).var_volatile_alarme != 0)
                             {                              {
                                 kill((*(*((struct_processus_fils *)                                  envoi_signal_processus(
                                           (*(*((struct_processus_fils *)
                                         (*(*((struct_liste_chainee *)                                          (*(*((struct_liste_chainee *)
                                         l_element_courant)).donnee).objet))                                          l_element_courant)).donnee).objet))
                                         .thread).pid, SIGURG);                                          .thread).pid, rpl_sigurg);
                             }                              }
                             else                              else
                             {                              {
                                 if ((*s_etat_processus).arret_depuis_abort                                  if ((*s_etat_processus).arret_depuis_abort
                                         == -1)                                          == -1)
                                 {                                  {
                                     kill((*(*((struct_processus_fils *)                                      envoi_signal_processus(
                                               (*(*((struct_processus_fils *)
                                             (*(*((struct_liste_chainee *)                                              (*(*((struct_liste_chainee *)
                                             l_element_courant)).donnee).objet))                                              l_element_courant)).donnee).objet))
                                             .thread).pid, SIGFABORT);                                              .thread).pid, rpl_sigabort);
                                 }                                  }
                                 else                                  else
                                 {                                  {
                                     kill((*(*((struct_processus_fils *)                                      envoi_signal_processus(
                                               (*(*((struct_processus_fils *)
                                             (*(*((struct_liste_chainee *)                                              (*(*((struct_liste_chainee *)
                                             l_element_courant)).donnee).objet))                                              l_element_courant)).donnee).objet))
                                             .thread).pid, SIGFSTOP);                                              .thread).pid, rpl_sigstop);
                                 }                                  }
                             }                              }
                         }                          }
Line 2913  rplinit(int argc, char *argv[], unsigned Line 5323  rplinit(int argc, char *argv[], unsigned
                                 if ((*s_etat_processus).var_volatile_alarme                                  if ((*s_etat_processus).var_volatile_alarme
                                         != 0)                                          != 0)
                                 {                                  {
                                     pthread_kill((*(*((struct_processus_fils *)                                      envoi_signal_thread(
                                               (*(*((struct_processus_fils *)
                                             (*(*((struct_liste_chainee *)                                              (*(*((struct_liste_chainee *)
                                             l_element_courant)).donnee).objet))                                              l_element_courant)).donnee).objet))
                                             .thread).tid, SIGURG);                                              .thread).tid, rpl_sigurg);
                                 }                                  }
                                 else                                  else
                                 {                                  {
                                     if ((*s_etat_processus).arret_depuis_abort                                      if ((*s_etat_processus).arret_depuis_abort
                                             == -1)                                              == -1)
                                     {                                      {
                                         pthread_kill(                                          envoi_signal_thread(
                                                 (*(*((struct_processus_fils *)                                                  (*(*((struct_processus_fils *)
                                                 (*(*((struct_liste_chainee *)                                                  (*(*((struct_liste_chainee *)
                                                 l_element_courant)).donnee)                                                  l_element_courant)).donnee)
                                                 .objet)).thread).tid,                                                  .objet)).thread).tid,
                                                 SIGFABORT);                                                  rpl_sigabort);
                                     }                                      }
                                     else                                      else
                                     {                                      {
                                         pthread_kill(                                          envoi_signal_thread(
                                                 (*(*((struct_processus_fils *)                                                  (*(*((struct_processus_fils *)
                                                 (*(*((struct_liste_chainee *)                                                  (*(*((struct_liste_chainee *)
                                                 l_element_courant)).donnee)                                                  l_element_courant)).donnee)
                                                 .objet)).thread).tid,                                                  .objet)).thread).tid,
                                                 SIGFSTOP);                                                  rpl_sigstop);
                                     }                                      }
                                 }                                  }
                             }                              }
Line 2966  rplinit(int argc, char *argv[], unsigned Line 5377  rplinit(int argc, char *argv[], unsigned
   
                     while((*s_etat_processus).l_base_pile_processus != NULL)                      while((*s_etat_processus).l_base_pile_processus != NULL)
                     {                      {
                         status = 0;  
   
                         l_element_courant = (void *)                          l_element_courant = (void *)
                                 (*s_etat_processus).l_base_pile_processus;                                  (*s_etat_processus).l_base_pile_processus;
   
Line 2992  rplinit(int argc, char *argv[], unsigned Line 5401  rplinit(int argc, char *argv[], unsigned
                                         .thread).nombre_objets_dans_pipe--;                                          .thread).nombre_objets_dans_pipe--;
   
                                 action.sa_handler = SIG_IGN;                                  action.sa_handler = SIG_IGN;
                                 action.sa_flags = SA_ONSTACK;                                  action.sa_flags = 0;
   
                                 if (sigaction(SIGPIPE, &action, &registre)                                  if (sigaction(SIGPIPE, &action, &registre)
                                         != 0)                                          != 0)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                           sem_post(&((*s_etat_processus)
                                                   .semaphore_fork));
                                           sem_post(
                                                   &semaphore_gestionnaires_signaux
                                                   );
                                           sem_destroy(
                                                   &semaphore_gestionnaires_signaux
                                                   );
                                           sem_destroy(&((*s_etat_processus)
                                                   .semaphore_fork));
   #                                   else
                                           sem_post((*s_etat_processus)
                                                   .semaphore_fork);
                                           sem_post(
                                                   semaphore_gestionnaires_signaux
                                                   );
                                           sem_destroy2(
                                                   semaphore_gestionnaires_signaux,
                                                   getpid(), SEM_SIGNAUX);
                                           sem_destroy3((*s_etat_processus)
                                                   .semphore_fork, getpid(),
                                                   pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       liberation_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                           stackoverflow_deinstall_handler();
   #                                   endif
   
   #                                   ifdef HAVE_SIGSEGV_RECOVERY
                                           if (debug == d_faux)
                                           {
                                               sigsegv_deinstall_handler();
                                           }
   #                                   endif
   
                                     pthread_mutex_unlock(                                      pthread_mutex_unlock(
                                             &((*s_etat_processus).mutex));                                              &((*s_etat_processus).mutex));
                                     return(EXIT_FAILURE);                                      return(EXIT_FAILURE);
Line 3021  rplinit(int argc, char *argv[], unsigned Line 5469  rplinit(int argc, char *argv[], unsigned
                                 if (sigaction(SIGPIPE, &registre, NULL)                                  if (sigaction(SIGPIPE, &registre, NULL)
                                         != 0)                                          != 0)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                           sem_post(&((*s_etat_processus)
                                                   .semaphore_fork));
                                           sem_post(
                                                   &semaphore_gestionnaires_signaux
                                                   );
                                           sem_destroy(
                                                   &semaphore_gestionnaires_signaux
                                                   );
                                           sem_destroy(&((*s_etat_processus)
                                                   .semaphore_fork));
   #                                   else
                                           sem_post((*s_etat_processus)
                                                   .semaphore_fork);
                                           sem_post(
                                                   semaphore_gestionnaires_signaux
                                                   );
                                           sem_destroy2(
                                                   semaphore_gestionnaires_signaux,
                                                   getpid(), SEM_SIGNAUX);
                                           sem_destroy3((*s_etat_processus)
                                                   .semphore_fork, getpid(),
                                                   pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       liberation_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                           stackoverflow_deinstall_handler();
   #                                   endif
   
   #                                   ifdef HAVE_SIGSEGV_RECOVERY
                                           if (debug == d_faux)
                                           {
                                               sigsegv_deinstall_handler();
                                           }
   #                                   endif
   
                                     pthread_mutex_unlock(                                      pthread_mutex_unlock(
                                             &((*s_etat_processus).mutex));                                              &((*s_etat_processus).mutex));
                                     return(EXIT_FAILURE);                                      return(EXIT_FAILURE);
Line 3038  rplinit(int argc, char *argv[], unsigned Line 5525  rplinit(int argc, char *argv[], unsigned
                         }                          }
   
                         nanosleep(&attente, NULL);                          nanosleep(&attente, NULL);
                           scrutation_interruptions(s_etat_processus);
                         pthread_mutex_lock(&((*s_etat_processus).mutex));                          pthread_mutex_lock(&((*s_etat_processus).mutex));
                     }                      }
   
Line 3191  rplinit(int argc, char *argv[], unsigned Line 5679  rplinit(int argc, char *argv[], unsigned
                      * le libérer...                       * le libérer...
                      */                       */
   
                     for(i = 0; i < (*s_etat_processus).nombre_variables; i++)                      liberation_arbre_variables_partagees(s_etat_processus,
                     {                              (*(*s_etat_processus).s_arbre_variables_partagees));
                         liberation(s_etat_processus,                      liberation_arbre_variables(s_etat_processus,
                                 (*s_etat_processus).s_liste_variables[i].objet);                              (*s_etat_processus).s_arbre_variables, d_vrai);
                         free((*s_etat_processus).s_liste_variables[i].nom);                      free((*s_etat_processus).pointeurs_caracteres_variables);
                     }  
   
                     free((*s_etat_processus).s_liste_variables);                      l_element_statique_courant = (*s_etat_processus)
                               .l_liste_variables_statiques;
   
                     for(i = 0; i < (*s_etat_processus)                      while(l_element_statique_courant != NULL)
                             .nombre_variables_statiques; i++)  
                     {                      {
                         liberation(s_etat_processus, (*s_etat_processus)                          l_element_statique_suivant =
                                 .s_liste_variables_statiques[i].objet);                              (*l_element_statique_courant).suivant;
                         free((*s_etat_processus)                          free(l_element_statique_courant);
                                 .s_liste_variables_statiques[i].nom);                          l_element_statique_courant = l_element_statique_suivant;
                     }                      }
   
                     free((*s_etat_processus).s_liste_variables_statiques);                      l_element_partage_courant = (*(*s_etat_processus)
                               .l_liste_variables_partagees);
   
                     for(i = 0; i < (*((*s_etat_processus)                      while(l_element_partage_courant != NULL)
                             .s_liste_variables_partagees)).nombre_variables;  
                             i++)  
                     {                      {
                         liberation(s_etat_processus, (*((*s_etat_processus)                          l_element_partage_suivant =
                                 .s_liste_variables_partagees)).table[i].objet);                                  (*l_element_partage_courant).suivant;
                         free((*((*s_etat_processus)                          free(l_element_partage_courant);
                                 .s_liste_variables_partagees)).table[i].nom);                          l_element_partage_courant = l_element_partage_suivant;
                     }                      }
   
                     free((struct_variable_partagee *)  
                             (*((*s_etat_processus).s_liste_variables_partagees))  
                             .table);  
   
                     /*                      /*
                      * Si resultats est non nul, rplinit a été appelé                       * Si resultats est non nul, rplinit a été appelé
                      * depuis rpl() [librpl] et non main().                       * depuis rpl() [librpl] et non main().
Line 3542  rplinit(int argc, char *argv[], unsigned Line 6024  rplinit(int argc, char *argv[], unsigned
   
         if (traitement_fichier_temporaire == 'Y')          if (traitement_fichier_temporaire == 'Y')
         {          {
             if (destruction_fichier(nom_fichier_temporaire) == d_erreur)              destruction_fichier(nom_fichier_temporaire);
             {  
                 return(EXIT_FAILURE);  
             }  
   
             free(nom_fichier_temporaire);              free(nom_fichier_temporaire);
         }          }
   
Line 3557  rplinit(int argc, char *argv[], unsigned Line 6035  rplinit(int argc, char *argv[], unsigned
         }          }
     }      }
   
 #   if !defined(Cygwin) && !defined(OpenBSD)  
     (*s_etat_processus).pile_signal.ss_flags = SS_DISABLE;  
     sigaltstack(&((*s_etat_processus).pile_signal), NULL);  
     free((*s_etat_processus).pile_signal.ss_sp);  
 #   endif  
   
     closelog();      closelog();
   
     pthread_mutex_destroy(&((*s_etat_processus).protection_liste_mutexes));      pthread_mutex_destroy(&((*s_etat_processus).protection_liste_mutexes));
     pthread_mutex_destroy(&((*((*s_etat_processus).s_liste_variables_partagees))  
             .mutex));  
   
     retrait_thread(s_etat_processus);      retrait_thread(s_etat_processus);
   
     pthread_mutex_destroy(&((*s_etat_processus).mutex));      pthread_mutex_destroy(&((*s_etat_processus).mutex));
     pthread_mutex_destroy(&((*s_etat_processus).mutex_allocation));      pthread_mutex_destroy(&((*s_etat_processus).mutex_allocation));
       pthread_mutex_destroy(&mutex_sections_critiques);
       pthread_mutex_destroy(&mutex_liste_variables_partagees);
   
 #   ifndef SEMAPHORES_NOMMES  #   ifndef SEMAPHORES_NOMMES
     sem_post(&((*s_etat_processus).semaphore_fork));      sem_post(&((*s_etat_processus).semaphore_fork));
     sem_destroy(&((*s_etat_processus).semaphore_fork));      sem_destroy(&((*s_etat_processus).semaphore_fork));
 #   else  #   else
     sem_post((*s_etat_processus).semaphore_fork);      sem_post((*s_etat_processus).semaphore_fork);
     sem_destroy2((*s_etat_processus).semaphore_fork, sem_fork);      sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(),
               SEM_FORK);
 #   endif  #   endif
   
     free((*s_etat_processus).localisation);      free((*s_etat_processus).localisation);
   
 #   ifndef SEMAPHORES_NOMMES  #   ifndef SEMAPHORES_NOMMES
     sem_destroy(&semaphore_liste_threads);  
 #   else  
     sem_destroy2(semaphore_liste_threads, sem_liste_threads);  
 #   endif  
 #   ifndef SEMAPHORES_NOMMES  
     sem_post(&semaphore_gestionnaires_signaux);      sem_post(&semaphore_gestionnaires_signaux);
     sem_destroy(&semaphore_gestionnaires_signaux);      sem_destroy(&semaphore_gestionnaires_signaux);
     sem_destroy(&semaphore_gestionnaires_signaux_atomique);  
 #   else  #   else
     sem_post(semaphore_gestionnaires_signaux);      sem_post(semaphore_gestionnaires_signaux);
     sem_destroy2(semaphore_gestionnaires_signaux, sem_gestionnaires_signaux);      sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX);
     sem_destroy2(semaphore_gestionnaires_signaux_atomique,  
             sem_gestionnaires_signaux_atomique);  
 #   endif  #   endif
   
 #   ifdef _BROKEN_SIGINFO      destruction_queue_signaux(s_etat_processus);
     destruction_fifos_signaux(s_etat_processus);      liberation_contexte_cas(s_etat_processus);
 #   undef return  
 #   endif  
   
     free((*s_etat_processus).chemin_fichiers_temporaires);      free((*s_etat_processus).chemin_fichiers_temporaires);
   
       if ((*s_etat_processus).requete_redemarrage == d_vrai)
       {
           chdir(repertoire_initial);
           execvp(arg_exec[0], &(arg_exec[0]));
           erreur = d_erreur;
       }
   
       free(arg_exec);
       arret_thread_signaux(s_etat_processus);
     free(s_etat_processus);      free(s_etat_processus);
   
 #   ifdef DEBUG_MEMOIRE  #   ifdef DEBUG_MEMOIRE
Line 3613  rplinit(int argc, char *argv[], unsigned Line 6086  rplinit(int argc, char *argv[], unsigned
     analyse_post_mortem();      analyse_post_mortem();
 #   endif  #   endif
   
   #   ifdef HAVE_STACK_OVERFLOW_RECOVERY
       stackoverflow_deinstall_handler();
   #   endif
   
   #   ifdef HAVE_SIGSEGV_RECOVERY
       if (debug == d_faux)
       {
           sigsegv_deinstall_handler();
       }
   #   endif
   
     return((erreur == d_absence_erreur) ? EXIT_SUCCESS : EXIT_FAILURE);      return((erreur == d_absence_erreur) ? EXIT_SUCCESS : EXIT_FAILURE);
 }  }
   
Line 3635  informations(struct_processus *s_etat_pr Line 6119  informations(struct_processus *s_etat_pr
         printf("      -l : licence d'utilisation\n");          printf("      -l : licence d'utilisation\n");
         printf("      -n : ignorance du signal HUP\n");          printf("      -n : ignorance du signal HUP\n");
         printf("      -p : précompilation du script avant exécution\n");          printf("      -p : précompilation du script avant exécution\n");
         printf("      -P : profilage\n");          printf("      -P : profilage (-P ou -PP)\n");
         printf("      -s : empêchement de l'ouverture de l'écran initial\n");          printf("      -s : empêchement de l'ouverture de l'écran initial\n");
         printf("      -S : exécution du script passé en ligne de commande\n");          printf("      -S : exécution du script passé en ligne de commande\n");
         printf("      -t : trace\n");          printf("      -t : trace\n");
Line 3656  informations(struct_processus *s_etat_pr Line 6140  informations(struct_processus *s_etat_pr
         printf("      -l : prints the user licence of the software\n");          printf("      -l : prints the user licence of the software\n");
         printf("      -n : ignores HUP signal\n");          printf("      -n : ignores HUP signal\n");
         printf("      -p : precompiles script\n");          printf("      -p : precompiles script\n");
         printf("      -P : computes profile data\n");          printf("      -P : computes profile data (-P or -PP)\n");
         printf("      -s : disables splash screen\n");          printf("      -s : disables splash screen\n");
         printf("      -S : executes script written in command line\n");          printf("      -S : executes script written in command line\n");
         printf("      -t : enables tracing mode\n");          printf("      -t : enables tracing mode\n");
Line 3668  informations(struct_processus *s_etat_pr Line 6152  informations(struct_processus *s_etat_pr
     return;      return;
 }  }
   
   
   logical1
   controle_integrite(struct_processus *s_etat_processus,
           unsigned char *executable_candidat, unsigned char *executable)
   {
       unsigned char       *md5;
       unsigned char       *sha1;
   
       if (strcmp(executable, "rplpp") == 0)
       {
           md5 = rplpp_md5;
           sha1 = rplpp_sha1;
       }
       else if (strcmp(executable, "rplfile") == 0)
       {
           md5 = rplfile_md5;
           sha1 = rplfile_sha1;
       }
       else if (strcmp(executable, "rpliconv") == 0)
       {
           md5 = rpliconv_md5;
           sha1 = rpliconv_sha1;
       }
       else if (strcmp(executable, "rplawk") == 0)
       {
           md5 = rplawk_md5;
           sha1 = rplawk_sha1;
       }
       else if (strcmp(executable, "rplconvert") == 0)
       {
           md5 = rplconvert_md5;
           sha1 = rplconvert_sha1;
       }
       else
       {
           return(d_faux);
       }
   
       if (controle(s_etat_processus, executable_candidat, "md5", md5) != d_vrai)
       {
           return(d_faux);
       }
   
       if (controle(s_etat_processus, executable_candidat, "sha1", sha1) != d_vrai)
       {
           return(d_faux);
       }
   
       return(d_vrai);
   }
   
   
   unsigned char *
   date_compilation()
   {
       unsigned char       *date;
   
       if ((date = malloc((strlen(d_date_en_rpl) + 1) * sizeof(unsigned char)))
               == NULL)
       {
           return(NULL);
       }
   
       strcpy(date, d_date_en_rpl);
   
       return(date);
   }
   
 // vim: ts=4  // vim: ts=4

Removed from v.1.45  
changed lines
  Added in v.1.135


CVSweb interface <joel.bertrand@systella.fr>