version 1.128, 2011/09/20 08:56:24
|
version 1.132, 2011/09/21 09:09:22
|
Line 101
|
Line 101
|
# include <pwd.h> |
# include <pwd.h> |
# include <sys/shm.h> |
# include <sys/shm.h> |
|
|
# ifndef __RPLCAS |
# ifndef IPCS_SYSV |
# ifndef IPCS_SYSV |
# include <semaphore.h> |
# include <semaphore.h> |
# else |
# else |
# include <sys/ipc.h> |
# include <sys/ipc.h> |
# include <sys/sem.h> |
# include <sys/sem.h> |
|
|
# ifdef OS2 |
|
# define INCL_DOSSEMAPHORES |
|
# define INCL_DOSMEMMGR |
|
# define INCL_DOSERRORS |
|
# include <os2.h> |
|
|
|
typedef struct _OS2SEM |
|
{ |
|
HMTX hmtx; |
|
HEV hev; |
|
ULONG shared; |
|
ULONG *cnt; |
|
ULONG *nopened; |
|
ULONG allocated; |
|
} sem_t; |
|
# else // IPCS_SYSV |
|
typedef struct |
|
{ |
|
int sem; |
|
int alloue; |
|
unsigned char *path; |
|
pid_t pid; |
|
pthread_t tid; |
|
} sem_t; |
|
# endif |
|
|
# ifdef OS2 |
# ifndef SEM_FAILED |
# define INCL_DOSSEMAPHORES |
# define SEM_FAILED NULL |
# define INCL_DOSMEMMGR |
|
# define INCL_DOSERRORS |
|
# include <os2.h> |
|
|
|
typedef struct _OS2SEM |
|
{ |
|
HMTX hmtx; |
|
HEV hev; |
|
ULONG shared; |
|
ULONG *cnt; |
|
ULONG *nopened; |
|
ULONG allocated; |
|
} sem_t; |
|
# else // IPCS_SYSV |
|
typedef struct |
|
{ |
|
int sem; |
|
int alloue; |
|
unsigned char *path; |
|
pid_t pid; |
|
} sem_t; |
|
# endif |
|
|
|
# ifndef SEM_FAILED |
|
# define SEM_FAILED NULL |
|
# endif |
|
|
|
sem_t *sem_open_SysV(const char *nom, int oflag, ...); |
|
int sem_init_SysV(sem_t *sem, int shared, unsigned int value); |
|
int sem_close_SysV(sem_t *sem); |
|
int sem_wait_SysV(sem_t *sem); |
|
int sem_trywait_SysV(sem_t *sem); |
|
int sem_post_SysV(sem_t *sem); |
|
int sem_getvalue_SysV(sem_t *sem, int *value); |
|
int sem_unlink_SysV(const char *nom); |
|
int sem_destroy_SysV(sem_t *sem); |
|
# endif |
# endif |
|
|
|
sem_t *sem_open_SysV(const char *nom, int oflag, ...); |
|
int sem_init_SysV(sem_t *sem, int shared, unsigned int value); |
|
int sem_close_SysV(sem_t *sem); |
|
int sem_wait_SysV(sem_t *sem); |
|
int sem_trywait_SysV(sem_t *sem); |
|
int sem_post_SysV(sem_t *sem); |
|
int sem_getvalue_SysV(sem_t *sem, int *value); |
|
int sem_unlink_SysV(const char *nom); |
|
int sem_destroy_SysV(sem_t *sem); |
# endif |
# endif |
|
|
# include <setjmp.h> |
# include <setjmp.h> |
Line 163
|
Line 162
|
|
|
# include "openssl/evp.h" |
# include "openssl/evp.h" |
# include "sqlite3.h" |
# include "sqlite3.h" |
|
# include "sigsegv.h" |
|
|
# define HAVE_INLINE |
# define HAVE_INLINE |
# define GSL_RANGE_CHECK_OFF |
# define GSL_RANGE_CHECK_OFF |
Line 300 union semun
|
Line 300 union semun
|
}; |
}; |
#endif |
#endif |
|
|
|
#ifndef RTLD_LOCAL |
|
# define RTLD_LOCAL 0 |
|
#endif |
|
|
|
#ifndef SIGSTKSZ |
|
# define SIGSTKSZ 65536 |
|
#endif |
|
|
/* |
/* |
================================================================================ |
================================================================================ |
Line 404 typedef unsigned char t_8_bits;
|
Line 411 typedef unsigned char t_8_bits;
|
# endif |
# endif |
|
|
# ifndef MAIN_RPL |
# ifndef MAIN_RPL |
extern jmp_buf contexte; |
extern jmp_buf contexte_ecriture; |
|
extern jmp_buf contexte_impression; |
extern jmp_buf contexte_initial; |
extern jmp_buf contexte_initial; |
extern jmp_buf contexte_processus; |
extern jmp_buf contexte_processus; |
extern jmp_buf contexte_thread; |
extern jmp_buf contexte_thread; |
Line 425 typedef unsigned char t_8_bits;
|
Line 433 typedef unsigned char t_8_bits;
|
* |
* |
# endif |
# endif |
semaphore_gestionnaires_signaux; |
semaphore_gestionnaires_signaux; |
|
|
|
extern volatile int routine_recursive; |
# else |
# else |
jmp_buf contexte; |
jmp_buf contexte_ecriture; |
|
jmp_buf contexte_impression; |
jmp_buf contexte_initial; |
jmp_buf contexte_initial; |
jmp_buf contexte_processus; |
jmp_buf contexte_processus; |
jmp_buf contexte_thread; |
jmp_buf contexte_thread; |
Line 450 typedef unsigned char t_8_bits;
|
Line 461 typedef unsigned char t_8_bits;
|
* |
* |
# endif |
# endif |
semaphore_gestionnaires_signaux; |
semaphore_gestionnaires_signaux; |
|
|
|
volatile int routine_recursive; |
# endif |
# endif |
#endif |
#endif |
|
|
#ifdef SEMAPHORES_NOMMES |
#ifdef SEMAPHORES_NOMMES |
sem_t *sem_init2(unsigned int valeur, pid_t pid); |
#define SEM_FORK 0 |
int sem_destroy2(sem_t *semaphore_p, pid_t pid); |
#define SEM_QUEUE 1 |
|
#define SEM_SIGNAUX 2 |
|
sem_t *sem_init2(unsigned int valeur, pid_t pid, int ordre); |
|
sem_t *sem_init3(unsigned int valeur, pid_t pid, pthread_t tid, int ordre); |
|
int sem_destroy2(sem_t *semaphore_p, pid_t pid, int ordre); |
|
int sem_destroy3(sem_t *semaphore_p, pid_t pid, pthread_t tid, int ordre); |
int sem_getvalue2(sem_t *semaphore, int *valeur); |
int sem_getvalue2(sem_t *semaphore, int *valeur); |
sem_t *sem_open2(pid_t pid); |
sem_t *sem_open2(pid_t pid, int ordre); |
|
|
// Le mutex est là uniquement pour pouvoir émuler le comportement |
// Le mutex est là uniquement pour pouvoir émuler le comportement |
// de sem_getvalue() sur un système comme MacOS X qui ne possède pas |
// de sem_getvalue() sur un système comme MacOS X qui ne possède pas |
Line 740 pid_t debug_fork();
|
Line 758 pid_t debug_fork();
|
Erreurs système |
Erreurs système |
-------------------------------------------------------------------------------- |
-------------------------------------------------------------------------------- |
*/ |
*/ |
#define DEBUG_ERREURS |
|
#ifdef DEBUG_ERREURS |
#ifdef DEBUG_ERREURS |
# ifdef MESSAGES |
# ifdef MESSAGES |
# define __erreur(i) i |
# define __erreur(i) i |
Line 1816 typedef struct processus
|
Line 1834 typedef struct processus
|
pthread_t thread_fusible; |
pthread_t thread_fusible; |
pthread_t thread_surveille_par_fusible; |
pthread_t thread_surveille_par_fusible; |
|
|
# if !defined(Cygwin) |
|
# if !(OpenBSD) |
|
stack_t pile_signal; |
|
# else |
|
# ifdef SA_ONSTACK |
|
# undef SA_ONSTACK |
|
# endif |
|
# define SA_ONSTACK 0 |
|
# endif |
|
# else |
|
# define SA_ONSTACK 0 |
|
# define RTLD_LOCAL 0 |
|
# endif |
|
|
|
volatile int pointeur_signal_ecriture; |
volatile int pointeur_signal_ecriture; |
volatile int pointeur_signal_lecture; |
volatile int pointeur_signal_lecture; |
volatile enum signaux_rpl signaux_en_queue[LONGUEUR_QUEUE_SIGNAUX]; |
volatile enum signaux_rpl signaux_en_queue[LONGUEUR_QUEUE_SIGNAUX]; |
Line 2050 typedef struct processus
|
Line 2054 typedef struct processus
|
|
|
/* Traitement des erreurs */ |
/* Traitement des erreurs */ |
|
|
unsigned int compteur_violation_d_acces; |
|
unsigned int erreur_compilation; |
unsigned int erreur_compilation; |
unsigned int erreur_execution; |
unsigned int erreur_execution; |
unsigned int erreur_systeme; |
unsigned int erreur_systeme; |
Line 2178 typedef struct processus
|
Line 2181 typedef struct processus
|
pthread_mutex_t mutex_allocation; |
pthread_mutex_t mutex_allocation; |
|
|
// Mutex autorisant les fork() |
// Mutex autorisant les fork() |
sem_t semaphore_fork; |
sem_t |
|
# ifdef SEMAPHORES_NOMMES |
|
* |
|
# endif |
|
semaphore_fork; |
|
|
/* Mutexes */ |
/* Mutexes */ |
|
|
Line 2898 void interruption2(int signal);
|
Line 2905 void interruption2(int signal);
|
void interruption3(int signal); |
void interruption3(int signal); |
void interruption4(int signal); |
void interruption4(int signal); |
void interruption5(int signal); |
void interruption5(int signal); |
|
void interruption_depassement_pile(int urgence, stackoverflow_context_t scp); |
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 3186 ssize_t write_atomic(struct_processus *s
|
Line 3194 ssize_t write_atomic(struct_processus *s
|
*/ |
*/ |
|
|
int alsprintf(unsigned char **strp, const char *fmt, ...); |
int alsprintf(unsigned char **strp, const char *fmt, ...); |
|
int interruption_violation_access(void *adresse_fautive, int gravite); |
int liste_variables(struct_processus *s_etat_processus, |
int liste_variables(struct_processus *s_etat_processus, |
struct_tableau_variables *tableau, int position, |
struct_tableau_variables *tableau, int position, |
struct_arbre_variables *l_element_courant); |
struct_arbre_variables *l_element_courant); |