version 1.41, 2010/08/18 12:56:55
|
version 1.49, 2010/09/06 16:50:17
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.0.18 |
RPL/2 (R) version 4.0.19 |
Copyright (C) 1989-2010 Dr. BERTRAND Joël |
Copyright (C) 1989-2010 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 |
#ifdef IPCS_SYSV |
#ifndef OS2 |
#ifndef OS2 |
unsigned char *chemin_semaphores_SysV; |
unsigned char *chemin_semaphores_SysV; |
#endif |
#endif |
Line 189 rplinit(int argc, char *argv[], unsigned
|
Line 189 rplinit(int argc, char *argv[], unsigned
|
|
|
(*s_etat_processus).rpl_home = rpl_home; |
(*s_etat_processus).rpl_home = rpl_home; |
|
|
insertion_thread(s_etat_processus, d_vrai); |
|
|
|
pthread_mutexattr_init(&attributs_mutex); |
pthread_mutexattr_init(&attributs_mutex); |
pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL); |
pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL); |
pthread_mutex_init(&((*s_etat_processus).mutex), &attributs_mutex); |
pthread_mutex_init(&((*s_etat_processus).mutex), &attributs_mutex); |
Line 242 rplinit(int argc, char *argv[], unsigned
|
Line 240 rplinit(int argc, char *argv[], unsigned
|
(*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 |
# ifdef IPCS_SYSV |
# ifndef OS2 |
# ifndef OS2 |
chemin_semaphores_SysV = (*s_etat_processus).chemin_fichiers_temporaires; |
chemin_semaphores_SysV = (*s_etat_processus).chemin_fichiers_temporaires; |
# endif |
# endif |
Line 250 rplinit(int argc, char *argv[], unsigned
|
Line 248 rplinit(int argc, char *argv[], unsigned
|
|
|
# ifdef _BROKEN_SIGINFO |
# ifdef _BROKEN_SIGINFO |
creation_fifos_signaux(s_etat_processus); |
creation_fifos_signaux(s_etat_processus); |
|
|
# ifdef return |
# ifdef return |
# undef return |
# undef return |
# endif |
# endif |
# define return destruction_fifos_signaux(s_etat_processus); return |
# define return destruction_fifos_signaux(s_etat_processus); return |
# endif |
# endif |
|
|
|
insertion_thread(s_etat_processus, d_vrai); |
|
|
|
# ifndef OS2 |
localisation_courante(s_etat_processus); |
localisation_courante(s_etat_processus); |
|
# else |
|
if ((*s_etat_processus).erreur_systeme != d_es) |
|
{ |
|
if (((*s_etat_processus).localisation = malloc((strlen(d_locale) + 1) * |
|
sizeof(unsigned char))) == NULL) |
|
{ |
|
if ((*s_etat_processus).langue == 'F') |
|
{ |
|
uprintf("+++Système : Mémoire insuffisante\n"); |
|
} |
|
else |
|
{ |
|
uprintf("+++System : Not enough memory\n"); |
|
} |
|
|
|
return(EXIT_FAILURE); |
|
} |
|
|
|
strcpy((*s_etat_processus).localisation, d_locale); |
|
} |
|
# endif |
|
|
(*s_etat_processus).erreur_systeme = d_es; |
(*s_etat_processus).erreur_systeme = d_es; |
|
|
if ((*s_etat_processus).localisation == NULL) |
if ((*s_etat_processus).localisation == NULL) |
Line 397 rplinit(int argc, char *argv[], unsigned
|
Line 419 rplinit(int argc, char *argv[], unsigned
|
# else |
# else |
action.sa_handler = interruption1; |
action.sa_handler = interruption1; |
# endif |
# endif |
action.sa_flags = SA_ONSTACK | SA_SIGINFO; |
action.sa_flags = SA_ONSTACK | SA_SIGINFO | SA_NODEFER; |
|
|
if (sigaction(SIGINT, &action, NULL) != 0) |
if (sigaction(SIGINT, &action, NULL) != 0) |
{ |
{ |
Line 443 rplinit(int argc, char *argv[], unsigned
|
Line 465 rplinit(int argc, char *argv[], unsigned
|
# else |
# else |
action.sa_handler = interruption4; |
action.sa_handler = interruption4; |
# endif |
# endif |
action.sa_flags = SA_ONSTACK | SA_SIGINFO; |
action.sa_flags = SA_ONSTACK | SA_SIGINFO | SA_NODEFER; |
|
|
if (sigaction(SIGSTART, &action, NULL) != 0) |
if (sigaction(SIGSTART, &action, NULL) != 0) |
{ |
{ |
Line 576 rplinit(int argc, char *argv[], unsigned
|
Line 598 rplinit(int argc, char *argv[], unsigned
|
# else |
# else |
action.sa_handler = interruption6; |
action.sa_handler = interruption6; |
# endif |
# endif |
action.sa_flags = SA_ONSTACK | SA_SIGINFO; |
action.sa_flags = SA_ONSTACK | SA_SIGINFO | SA_NODEFER; |
|
|
if (sigaction(SIGINJECT, &action, NULL) != 0) |
if (sigaction(SIGINJECT, &action, NULL) != 0) |
{ |
{ |
Line 600 rplinit(int argc, char *argv[], unsigned
|
Line 622 rplinit(int argc, char *argv[], unsigned
|
# else |
# else |
action.sa_handler = interruption9; |
action.sa_handler = interruption9; |
# endif |
# endif |
action.sa_flags = SA_ONSTACK | SA_SIGINFO; |
action.sa_flags = SA_ONSTACK | SA_SIGINFO | SA_NODEFER; |
|
|
if (sigaction(SIGABORT, &action, NULL) != 0) |
if (sigaction(SIGABORT, &action, NULL) != 0) |
{ |
{ |
Line 1577 rplinit(int argc, char *argv[], unsigned
|
Line 1599 rplinit(int argc, char *argv[], unsigned
|
# else |
# else |
action.sa_handler = interruption10; |
action.sa_handler = interruption10; |
# endif |
# endif |
action.sa_flags = SA_ONSTACK | SA_SIGINFO; |
action.sa_flags = SA_ONSTACK | SA_SIGINFO | SA_NODEFER; |
|
|
if (sigaction(SIGHUP, &action, NULL) != 0) |
if (sigaction(SIGHUP, &action, NULL) != 0) |
{ |
{ |
Line 1952 rplinit(int argc, char *argv[], unsigned
|
Line 1974 rplinit(int argc, char *argv[], unsigned
|
(*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; |
|
(*s_etat_processus).var_volatile_processus_racine = -1; |
(*s_etat_processus).var_volatile_traitement_retarde_stop = 0; |
(*s_etat_processus).var_volatile_traitement_retarde_stop = 0; |
(*s_etat_processus).var_volatile_alarme = 0; |
(*s_etat_processus).var_volatile_alarme = 0; |
(*s_etat_processus).var_volatile_requete_arret = 0; |
(*s_etat_processus).var_volatile_requete_arret = 0; |