Diff for /rpl/src/rpl.h between versions 1.277 and 1.306

version 1.277, 2015/09/28 15:23:04 version 1.306, 2017/06/29 14:54:42
Line 1 Line 1
   #define DEBUG_ERREURS
 /*  /*
 ================================================================================  ================================================================================
   RPL/2 (R) version 4.1.23    RPL/2 (R) version 4.1.27
   Copyright (C) 1989-2015 Dr. BERTRAND Joël    Copyright (C) 1989-2017 Dr. BERTRAND Joël
   
   This file is part of RPL/2.    This file is part of RPL/2.
   
Line 64 Line 65
 #   define SA_ONSTACK   0  #   define SA_ONSTACK   0
 #endif  #endif
   
   #ifdef BROKEN_SIGSEGV
   #   undef HAVE_STACK_OVERFLOW_RECOVERY
   #   undef HAVE_SIGSEGV_RECOVERY
   #endif
   
   #define DEBUG_TRACE     uprintf("[%d/%X] %s(%d)\n", \
           getpid(), pthread_self(), __FILE__, __LINE__);
   #define TEST_ABSENCE_FICHIER(nom) \
           { int ios; struct stat *buf; ios = stat(nom, buf); \
               if (ios == 0) BUG(1, uprintf("File %s found!\n", nom)); }
   
 /*  /*
 ================================================================================  ================================================================================
Line 210 Line 221
 #   endif  #   endif
   
 #   include "sqlite3.h"  #   include "sqlite3.h"
 #   include "sigsegv.h"  
   #   ifndef BROKEN_SIGSEGV
   #       include "sigsegv.h"
   #   endif
   
 #   ifdef OS2  #   ifdef OS2
         // Bug de libsigsegv          // Bug de libsigsegv
 #       undef HAVE_STACK_OVERFLOW_RECOVERY  #       undef HAVE_STACK_OVERFLOW_RECOVERY
Line 267 Line 282
 #   define __STATIC_MUTEX_INITIALIZATION__  #   define __STATIC_MUTEX_INITIALIZATION__
 #endif  #endif
   
   
 /*  /*
 ================================================================================  ================================================================================
   Bugs spécifiques    Bugs spécifiques
Line 515  union semun Line 531  union semun
   
     __EXTERN__ pid_t                pid_processus_pere;      __EXTERN__ pid_t                pid_processus_pere;
   
     __EXTERN__ pthread_mutex_t      mutex_liste_threads      __EXTERN__ pthread_mutex_t      mutex_liste_threads;
                                             __STATIC_MUTEX_INITIALIZATION__;  
     __EXTERN__ pthread_mutex_t      mutex_creation_variable_partagee      __EXTERN__ pthread_mutex_t      mutex_creation_variable_partagee
                                             __STATIC_MUTEX_INITIALIZATION__;                                              __STATIC_MUTEX_INITIALIZATION__;
     __EXTERN__ pthread_mutex_t      mutex_sections_critiques;      __EXTERN__ pthread_mutex_t      mutex_sections_critiques;
Line 524  union semun Line 539  union semun
     __EXTERN__ pthread_mutex_t      mutex_sem __STATIC_MUTEX_INITIALIZATION__;      __EXTERN__ pthread_mutex_t      mutex_sem __STATIC_MUTEX_INITIALIZATION__;
   
     __EXTERN__ volatile int         routine_recursive;      __EXTERN__ volatile int         routine_recursive;
       __EXTERN__ volatile int         nombre_thread_surveillance_processus;
   
 #   define SEM_FORK                 0  #   define SEM_FORK                 0
 #   define SEM_QUEUE                1  #   define SEM_QUEUE                1
Line 591  union semun Line 607  union semun
 #   define fflush(flux) fflush((flux == stdout) ? stderr : flux)  #   define fflush(flux) fflush((flux == stdout) ? stderr : flux)
 #endif  #endif
   
 // Ajout d'un timeout sur les fonctions pipe() pour éviter une erreur  
 // système dans le cas où l'on a atteint le nombre maximale de fichiers  
 // ouverts.  
   
 #define pipe(descripteurs) \  
     ({ \  
         struct timespec temporisation; \  
         int erreur, nombre_echecs; \  
         nombre_echecs = 0; \  
         do \  
         { \  
             if ((erreur = pipe(descripteurs)) == 0) break; \  
             nombre_echecs++; \  
             temporisation.tv_sec = 0; \  
             temporisation.tv_nsec = ((long) 1000000000) * rand(); \  
             nanosleep(&temporisation, NULL); \  
         } while(nombre_echecs < 100); \  
         erreur; \  
      })  
   
 // Redéfinition de abs pour un fonctionnement en entier de type long long int  // Redéfinition de abs pour un fonctionnement en entier de type long long int
   
 #ifdef __GNUC__  #ifdef __GNUC__
Line 811  pid_t debug_fork(); Line 807  pid_t debug_fork();
 #       else  #       else
 #           define __erreur_(i) i  #           define __erreur_(i) i
 #       endif  #       endif
 #       define __erreur(i)  ({ if (strstr(__FUNCTION__, "recherche_variable") \  #       define __erreur(i)  ({ int ios; ios = errno; \
                 == NULL) ufprintf(stderr, \                  if (strstr(__FUNCTION__, "recherche_variable") \
                 "ERROR %d AT %s() FROM %s LINE %d\n", \                  == NULL) { if(ios != 0) \
                 i, __FUNCTION__, __FILE__, __LINE__); i; })                  ufprintf(stderr, "LAST ERROR: %s\n", strerror(ios)); \
                   ufprintf(stderr, "ERROR %d AT %s() FROM %s LINE %d\n", \
                   i, __FUNCTION__, __FILE__, __LINE__); BACKTRACE(16); } i; })
 #   endif  #   endif
 #else  #else
 #   define __erreur(i)  i  #   define __erreur(i)  i
 #   define __erreur_(i) i  #   define __erreur_(i) i
 #endif  #endif
   
   #ifdef DEBUG_FICHIERS
   #   define open(a, ...) \
           ({ ufprintf(stderr, "[%d] OPEN %s AT %s() FROM %s LINE %d\n", \
           getpid(), a, \
           __FUNCTION__, __FILE__, __LINE__); open(a, __VA_ARGS__); })
   #   define pipe(a) \
           ({ ufprintf(stderr, "[%d] PIPE %s AT %s() FROM %s LINE %d\n", \
           getpid(), a, \
           __FUNCTION__, __FILE__, __LINE__); pipe(a); })
   #   define shm_open(a, ...) \
           ({ ufprintf(stderr, "[%d] SHM_OPEN %s AT %s() FROM %s LINE %d\n", \
           getpid(), a, \
           __FUNCTION__, __FILE__, __LINE__); shm_open(a, __VA_ARGS__); })
   #   define shm_unlink(a) \
           ({ ufprintf(stderr, "[%d] SHM_UNLINK %s AT %s() FROM %s LINE %d\n", \
           getpid(), a, \
           __FUNCTION__, __FILE__, __LINE__); shm_unlink(a); })
   #   define sem_open(a, ...) \
           ({ ufprintf(stderr, "[%d] SEM_OPEN %s AT %s() FROM %s LINE %d\n", \
           getpid(), a, \
           __FUNCTION__, __FILE__, __LINE__); sem_open(a, __VA_ARGS__); })
   #   define sem_unlink(a) \
           ({ ufprintf(stderr, "[%d] SEM_UNLINK %s AT %s() FROM %s LINE %d\n", \
           getpid(), a, \
           __FUNCTION__, __FILE__, __LINE__); sem_unlink(a); })
   #   define close(a) \
           ({ ufprintf(stderr, "[%d] CLOSE %s AT %s() FROM %s LINE %d\n", \
           getpid(), a, \
           __FUNCTION__, __FILE__, __LINE__); close(a); })
   #endif
   
 // -1 : erreur provoquée par une bibliothèque externe  // -1 : erreur provoquée par une bibliothèque externe
 #ifndef RPLARGS  #ifndef RPLARGS
Line 1015  pid_t debug_fork(); Line 1043  pid_t debug_fork();
 #define BIN __RPL_BIN  #define BIN __RPL_BIN
 #define CHN __RPL_CHN  #define CHN __RPL_CHN
 #define CPL __RPL_CPL  #define CPL __RPL_CPL
   #define EXT __RPL_EXT
 #define FCH __RPL_FCH  #define FCH __RPL_FCH
 #define FCT __RPL_FCT  #define FCT __RPL_FCT
 #define INT __RPL_INT  #define INT __RPL_INT
Line 1040  pid_t debug_fork(); Line 1069  pid_t debug_fork();
   
 enum t_rplcas_commandes     { RPLCAS_INTEGRATION = 0, RPLCAS_LIMITE };  enum t_rplcas_commandes     { RPLCAS_INTEGRATION = 0, RPLCAS_LIMITE };
   
 enum t_type     { ADR = 0, ALG, BIN, CHN, CPL, FCH, FCT, INT, LST,  enum t_type     { ADR = 0, ALG, BIN, CHN, CPL, EXT, FCH, FCT, INT, LST,
                 MCX, MIN, MRL, MTX, NOM, NON, PRC, REC, REL, RPN, SCK,                  MCX, MIN, MRL, MTX, NOM, NON, PRC, REC, REL, RPN, SCK,
                 SLB, SPH, SQL, TBL, VCX, VIN, VRL };                  SLB, SPH, SQL, TBL, VCX, VIN, VRL };
   
Line 1064  enum t_type  { ADR = 0, ALG, BIN, CHN, C Line 1093  enum t_type  { ADR = 0, ALG, BIN, CHN, C
             Sans objet.              Sans objet.
             Type C/Fortran : complex16              Type C/Fortran : complex16
   
       EXT : type géré dans une bibliothèque externe.
   
     FCH : descripteur de fichier (struct_fichier *).      FCH : descripteur de fichier (struct_fichier *).
   
     FCT : déclaration d'une fonction et de son nombre d'arguments      FCT : déclaration d'une fonction et de son nombre d'arguments
Line 1129  enum t_type  { ADR = 0, ALG, BIN, CHN, C Line 1160  enum t_type  { ADR = 0, ALG, BIN, CHN, C
 typedef struct objet  typedef struct objet
 {  {
     enum t_type         type;      enum t_type         type;
       integer8            extension_type;
       void                *descripteur_bibliotheque;
   
     volatile long       nombre_occurrences;      volatile long       nombre_occurrences;
   
Line 1975  typedef struct processus Line 2008  typedef struct processus
     unsigned char               evaluation_forcee;                  /*Y/N*/      unsigned char               evaluation_forcee;                  /*Y/N*/
     unsigned char               instruction_valide;                 /*Y/N*/      unsigned char               instruction_valide;                 /*Y/N*/
     unsigned char               instruction_intrinseque;            /*Y/I/N*/      unsigned char               instruction_intrinseque;            /*Y/I/N*/
       unsigned char               instruction_sensible;               /*Y/N*/
     unsigned char               test_instruction;                   /*Y/N*/      unsigned char               test_instruction;                   /*Y/N*/
     unsigned char               affichage_arguments;                /*Y/N*/      unsigned char               affichage_arguments;                /*Y/N*/
     unsigned char               constante_symbolique;               /*Y/N*/      unsigned char               constante_symbolique;               /*Y/N*/
Line 2470  void *rpl_malloc(struct_processus *s_eta Line 2504  void *rpl_malloc(struct_processus *s_eta
 void *rpl_realloc(struct_processus *s_etat_processus, void *ptr, size_t s);  void *rpl_realloc(struct_processus *s_etat_processus, void *ptr, size_t s);
 void rpl_free(struct_processus *s_etat_processus, void *ptr);  void rpl_free(struct_processus *s_etat_processus, void *ptr);
 void *sys_malloc(size_t s);  void *sys_malloc(size_t s);
   void *sys_realloc(void *ptr, size_t s);
 void sys_free(void *ptr);  void sys_free(void *ptr);
   
 /*  /*
Line 3129  void interruption3(int signal); Line 3164  void interruption3(int signal);
 void interruption4(int signal);  void interruption4(int signal);
 void interruption5(int signal);  void interruption5(int signal);
 void interruption6(int signal);  void interruption6(int signal);
 void interruption_depassement_pile(int urgence, stackoverflow_context_t scp);  #ifdef HAVE_SIGSEGV_RECOVERY
       void interruption_depassement_pile(int urgence,
               stackoverflow_context_t scp);
   #endif
 void inversion_matrice(struct_processus *s_etat_processus,  void inversion_matrice(struct_processus *s_etat_processus,
         struct_matrice *s_matrice);          struct_matrice *s_matrice);
 void lancement_daemon(struct_processus *s_etat_processus);  void lancement_daemon(struct_processus *s_etat_processus);
Line 3213  void liberation_queue_signaux(struct_pro Line 3251  void liberation_queue_signaux(struct_pro
 void destruction_queue_signaux(struct_processus *s_etat_processus);  void destruction_queue_signaux(struct_processus *s_etat_processus);
 int envoi_signal_contexte(struct_processus *s_etat_processus,  int envoi_signal_contexte(struct_processus *s_etat_processus,
         enum signaux_rpl signal);          enum signaux_rpl signal);
 int envoi_signal_processus(pid_t pid, enum signaux_rpl signal);  int envoi_signal_processus(pid_t pid, enum signaux_rpl signal,
           logical1 test_ouverture);
 int envoi_signal_thread(pthread_t tid, enum signaux_rpl signal);  int envoi_signal_thread(pthread_t tid, enum signaux_rpl signal);
 #endif  #endif
   

Removed from v.1.277  
changed lines
  Added in v.1.306


CVSweb interface <joel.bertrand@systella.fr>