--- rpl/src/rpl.h 2015/02/01 22:50:00 1.263 +++ rpl/src/rpl.h 2016/03/21 12:08:06 1.291 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.20 - Copyright (C) 1989-2015 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.25 + Copyright (C) 1989-2016 Dr. BERTRAND Joël This file is part of RPL/2. @@ -38,6 +38,10 @@ # ifdef OpenBSD # define _BSD_SOURCE # endif + +# ifdef FreeBSD +# define __BSD_VISIBLE 1 +# endif #endif #ifdef OS2 @@ -60,6 +64,11 @@ # define SA_ONSTACK 0 #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)); } /* ================================================================================ @@ -212,7 +221,6 @@ # undef HAVE_STACK_OVERFLOW_RECOVERY # endif -# define HAVE_INLINE # define GSL_RANGE_CHECK_OFF # include "gsl/gsl_cdf.h" # include "gsl/gsl_cblas.h" @@ -323,6 +331,7 @@ typedef struct queue_signaux volatile logical1 requete_arret; pthread_t thread_signaux; + pid_t controle; volatile struct { @@ -511,8 +520,7 @@ union semun __EXTERN__ pid_t pid_processus_pere; - __EXTERN__ pthread_mutex_t mutex_liste_threads - __STATIC_MUTEX_INITIALIZATION__; + __EXTERN__ pthread_mutex_t mutex_liste_threads; __EXTERN__ pthread_mutex_t mutex_creation_variable_partagee __STATIC_MUTEX_INITIALIZATION__; __EXTERN__ pthread_mutex_t mutex_sections_critiques; @@ -587,26 +595,6 @@ union semun # define fflush(flux) fflush((flux == stdout) ? stderr : flux) #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 #ifdef __GNUC__ @@ -769,6 +757,7 @@ pid_t debug_fork(); #define d_SPH "Semaphore $n 'name'" #define d_TAB "<[ table ]>" #define d_MTX "Mutex $n" +#define d_REC "Record /'name_1', ..., 'name_n'/" /* -------------------------------------------------------------------------------- @@ -809,7 +798,7 @@ pid_t debug_fork(); # define __erreur(i) ({ if (strstr(__FUNCTION__, "recherche_variable") \ == NULL) ufprintf(stderr, \ "ERROR %d AT %s() FROM %s LINE %d\n", \ - i, __FUNCTION__, __FILE__, __LINE__); i; }) + i, __FUNCTION__, __FILE__, __LINE__); BACKTRACE(16); i; }) # endif #else # define __erreur(i) i @@ -1021,6 +1010,7 @@ pid_t debug_fork(); #define NOM __RPL_NOM #define NON __RPL_NON #define PRC __RPL_PRC +#define REC __RPL_REC #define REL __RPL_REL #define RPN __RPL_RPN #define SCK __RPL_SCK @@ -1035,7 +1025,7 @@ pid_t debug_fork(); enum t_rplcas_commandes { RPLCAS_INTEGRATION = 0, RPLCAS_LIMITE }; enum t_type { ADR = 0, ALG, BIN, CHN, CPL, FCH, FCT, INT, LST, - MCX, MIN, MRL, MTX, NOM, NON, PRC, REL, RPN, SCK, + MCX, MIN, MRL, MTX, NOM, NON, PRC, REC, REL, RPN, SCK, SLB, SPH, SQL, TBL, VCX, VIN, VRL }; /* @@ -1309,6 +1299,20 @@ typedef struct connecteur_sql */ #ifndef RPLARGS + +# define d_BIND_TO_DEVICE 0 +# define d_BROADCAST 1 +# define d_DONT_ROUTE 2 +# define d_KEEP_ALIVE 3 +# define d_PRIORITY 4 +# define d_RECEIVE_BUFFER 5 +# define d_FORCE_RECEIVE_BUFFER 6 +# define d_SEND_BUFFER 7 +# define d_FORCE_SEND_BUFFER 8 +# define d_RECEIVING_TIMEOUT 9 +# define d_SENDING_TIMEOUT 10 +# define d_REUSE_ADDRESS 11 + typedef struct socket { int domaine; @@ -1327,6 +1331,13 @@ typedef struct socket unsigned char protection; unsigned char type[19 + 1]; + integer8 options; + int priorite; + int buffer_reception; + int buffer_emission; + int timeout_emission; + int timeout_reception; + struct_objet *format; } struct_socket; #endif @@ -1948,6 +1959,7 @@ typedef struct processus unsigned char evaluation_forcee; /*Y/N*/ unsigned char instruction_valide; /*Y/N*/ unsigned char instruction_intrinseque; /*Y/I/N*/ + unsigned char instruction_sensible; /*Y/N*/ unsigned char test_instruction; /*Y/N*/ unsigned char affichage_arguments; /*Y/N*/ unsigned char constante_symbolique; /*Y/N*/ @@ -2392,7 +2404,7 @@ typedef struct processus integer8 taille_pile_objets; struct_objet *pile_objets; -# define TAILLE_CACHE 1024 +# define TAILLE_CACHE 1024 # define CACHE(type, nom) \ type *objets_##nom[TAILLE_CACHE]; \ volatile int pointeur_##nom; @@ -2443,6 +2455,7 @@ void *rpl_malloc(struct_processus *s_eta void *rpl_realloc(struct_processus *s_etat_processus, void *ptr, size_t s); void rpl_free(struct_processus *s_etat_processus, void *ptr); void *sys_malloc(size_t s); +void *sys_realloc(void *ptr, size_t s); void sys_free(void *ptr); /* @@ -3186,7 +3199,8 @@ void liberation_queue_signaux(struct_pro void destruction_queue_signaux(struct_processus *s_etat_processus); int envoi_signal_contexte(struct_processus *s_etat_processus, 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); #endif