version 1.80, 2011/09/03 10:31:50
|
version 1.93, 2011/09/20 19:28:39
|
Line 23
|
Line 23
|
#define MAIN_RPL |
#define MAIN_RPL |
#include "rpl-conv.h" |
#include "rpl-conv.h" |
|
|
#ifdef IPCS_SYSV |
|
#ifndef OS2 |
|
unsigned char *chemin_semaphores_SysV; |
|
#endif |
|
#endif |
|
|
|
|
|
/* |
/* |
================================================================================ |
================================================================================ |
Line 105 rplinit(int argc, char *argv[], unsigned
|
Line 99 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; |
|
pid_processus_pere = getpid(); |
|
|
# ifdef DEBUG_MEMOIRE |
# ifdef DEBUG_MEMOIRE |
debug_memoire_initialisation(); |
debug_memoire_initialisation(); |
Line 114 rplinit(int argc, char *argv[], unsigned
|
Line 110 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 203 rplinit(int argc, char *argv[], unsigned
|
Line 192 rplinit(int argc, char *argv[], unsigned
|
pthread_mutexattr_destroy(&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"); |
if ((*s_etat_processus).langue == 'F') |
} |
{ |
else |
uprintf("+++Système : Mémoire insuffisante\n"); |
{ |
} |
uprintf("+++System : Not enough memory\n"); |
else |
} |
{ |
|
uprintf("+++System : Not enough memory\n"); |
|
} |
|
|
return(EXIT_FAILURE); |
return(EXIT_FAILURE); |
} |
} |
# endif |
# endif |
|
|
pthread_mutexattr_init(&attributs_mutex); |
pthread_mutexattr_init(&attributs_mutex); |
Line 242 rplinit(int argc, char *argv[], unsigned
|
Line 231 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 IPCS_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 |
# ifndef OS2 |
localisation_courante(s_etat_processus); |
localisation_courante(s_etat_processus); |
Line 338 rplinit(int argc, char *argv[], unsigned
|
Line 314 rplinit(int argc, char *argv[], unsigned
|
home = ""; |
home = ""; |
} |
} |
|
|
// Initialisation d'une clef |
|
|
|
if (pthread_key_create(&semaphore_fork_processus_courant, NULL) != 0) |
|
{ |
|
if ((*s_etat_processus).langue == 'F') |
|
{ |
|
printf("+++Système : Mémoire insuffisante\n"); |
|
} |
|
else |
|
{ |
|
printf("+++System : Not enough memory\n"); |
|
} |
|
|
|
return(EXIT_FAILURE); |
|
} |
|
|
|
# ifndef SEMAPHORES_NOMMES |
|
if (pthread_setspecific(semaphore_fork_processus_courant, |
|
&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
if (pthread_setspecific(semaphore_fork_processus_courant, |
|
(*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
|
{ |
|
if ((*s_etat_processus).langue == 'F') |
|
{ |
|
printf("+++Système : Mémoire insuffisante\n"); |
|
} |
|
else |
|
{ |
|
printf("+++System : Not enough memory\n"); |
|
} |
|
|
|
return(EXIT_FAILURE); |
|
} |
|
|
|
// Initialisation d'une pile de signal pour récupérer les |
// Initialisation d'une pile de signal pour récupérer les |
// débordement de pile |
// débordement de pile |
|
|
Line 416 rplinit(int argc, char *argv[], unsigned
|
Line 356 rplinit(int argc, char *argv[], unsigned
|
} |
} |
# endif |
# endif |
|
|
# ifndef _BROKEN_SIGINFO |
|
action.sa_sigaction = interruption1; |
|
# else |
|
action.sa_handler = interruption1; |
action.sa_handler = interruption1; |
# endif |
action.sa_flags = SA_ONSTACK; |
action.sa_flags = SA_ONSTACK | SA_SIGINFO; |
|
|
|
if (sigaction(SIGINT, &action, NULL) != 0) |
if (sigaction(SIGINT, &action, NULL) != 0) |
{ |
{ |
Line 440 rplinit(int argc, char *argv[], unsigned
|
Line 376 rplinit(int argc, char *argv[], unsigned
|
return(EXIT_FAILURE); |
return(EXIT_FAILURE); |
} |
} |
|
|
if (sigaction(SIGTERM, &action, NULL) != 0) |
signal_test = SIGTEST; |
|
kill(getpid(), SIGINT); |
|
|
|
if (signal_test != SIGINT) |
{ |
{ |
erreur = d_es_signal; |
erreur = d_es_signal; |
|
|
Line 457 rplinit(int argc, char *argv[], unsigned
|
Line 396 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) |
|
{ |
|
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); |
|
} |
|
|
|
# ifndef _BROKEN_SIGINFO |
|
action.sa_sigaction = interruption4; |
|
# else |
|
action.sa_handler = interruption4; |
|
# endif |
|
// SIGCONT ne doit pas pouvoir être appelé depuis son gestionnaire. |
|
action.sa_flags = SA_ONSTACK | SA_SIGINFO; |
|
|
|
if (sigaction(SIGSTART, &action, NULL) != 0) |
|
{ |
{ |
if ((*s_etat_processus).langue == 'F') |
erreur = d_es_signal; |
{ |
|
printf("+++Système : Initialisation des signaux POSIX " |
|
"impossible\n"); |
|
} |
|
else |
|
{ |
|
printf("+++System : Initialization of POSIX signals failed\n"); |
|
} |
|
|
|
return(EXIT_FAILURE); |
|
} |
|
|
|
if (sigaction(SIGCONT, &action, NULL) != 0) |
|
{ |
|
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 517 rplinit(int argc, char *argv[], unsigned
|
Line 413 rplinit(int argc, char *argv[], unsigned
|
return(EXIT_FAILURE); |
return(EXIT_FAILURE); |
} |
} |
|
|
# ifndef _BROKEN_SIGINFO |
signal_test = SIGTEST; |
action.sa_sigaction = interruption5; |
kill(getpid(), SIGTERM); |
# else |
|
action.sa_handler = interruption5; |
|
# endif |
|
action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO; |
|
|
|
if (sigaction(SIGFSTOP, &action, NULL) != 0) |
if (signal_test != SIGTERM) |
{ |
{ |
erreur = d_es_signal; |
erreur = d_es_signal; |
|
|
Line 541 rplinit(int argc, char *argv[], unsigned
|
Line 433 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 = SA_NODEFER | SA_ONSTACK; |
# 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; |
|
|
|
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 565 rplinit(int argc, char *argv[], unsigned
|
Line 451 rplinit(int argc, char *argv[], unsigned
|
return(EXIT_FAILURE); |
return(EXIT_FAILURE); |
} |
} |
|
|
# ifndef _BROKEN_SIGINFO |
signal_test = SIGTEST; |
action.sa_sigaction = interruption8; |
kill(getpid(), SIGTSTP); |
# else |
|
action.sa_handler = interruption8; |
|
# endif |
|
action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO; |
|
|
|
if (sigaction(SIGURG, &action, NULL) != 0) |
if (signal_test != SIGTSTP) |
{ |
{ |
erreur = d_es_signal; |
erreur = d_es_signal; |
|
|
Line 589 rplinit(int argc, char *argv[], unsigned
|
Line 471 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 = SA_NODEFER | SA_ONSTACK; |
# 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) |
{ |
{ |
Line 613 rplinit(int argc, char *argv[], unsigned
|
Line 491 rplinit(int argc, char *argv[], unsigned
|
return(EXIT_FAILURE); |
return(EXIT_FAILURE); |
} |
} |
|
|
# ifndef _BROKEN_SIGINFO |
signal_test = SIGTEST; |
action.sa_sigaction = interruption6; |
kill(getpid(), SIGPIPE); |
# else |
|
action.sa_handler = interruption6; |
|
# endif |
|
action.sa_flags = SA_ONSTACK | SA_SIGINFO | SA_NODEFER; |
|
|
|
if (sigaction(SIGINJECT, &action, NULL) != 0) |
if (signal_test != SIGPIPE) |
{ |
{ |
erreur = d_es_signal; |
erreur = d_es_signal; |
|
|
Line 637 rplinit(int argc, char *argv[], unsigned
|
Line 511 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 = SA_NODEFER | SA_ONSTACK; |
# else |
|
action.sa_handler = interruption9; |
|
# endif |
|
action.sa_flags = SA_ONSTACK | SA_SIGINFO | SA_NODEFER; |
|
|
|
if (sigaction(SIGABORT, &action, NULL) != 0) |
if (sigaction(SIGALRM, &action, NULL) != 0) |
{ |
{ |
erreur = d_es_signal; |
erreur = d_es_signal; |
|
|
Line 661 rplinit(int argc, char *argv[], unsigned
|
Line 531 rplinit(int argc, char *argv[], unsigned
|
return(EXIT_FAILURE); |
return(EXIT_FAILURE); |
} |
} |
|
|
# ifndef _BROKEN_SIGINFO |
signal_test = SIGTEST; |
action.sa_sigaction = interruption1; |
kill(getpid(), SIGALRM); |
# else |
|
action.sa_handler = interruption1; |
|
# endif |
|
action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO; |
|
|
|
if (sigaction(SIGALRM, &action, NULL) != 0) |
if (signal_test != SIGALRM) |
{ |
{ |
erreur = d_es_signal; |
erreur = d_es_signal; |
|
|
Line 685 rplinit(int argc, char *argv[], unsigned
|
Line 551 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 738 rplinit(int argc, char *argv[], unsigned
|
Line 599 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 1533 rplinit(int argc, char *argv[], unsigned
|
Line 1403 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 1579 rplinit(int argc, char *argv[], unsigned
|
Line 1455 rplinit(int argc, char *argv[], unsigned
|
|
|
if (debug == d_faux) |
if (debug == d_faux) |
{ |
{ |
|
action.sa_handler = interruption3; |
|
action.sa_flags = SA_NODEFER | SA_ONSTACK; |
|
|
if (sigaction(SIGSEGV, &action, NULL) != 0) |
if (sigaction(SIGSEGV, &action, NULL) != 0) |
{ |
{ |
if ((*s_etat_processus).langue == 'F') |
if ((*s_etat_processus).langue == 'F') |
Line 1614 rplinit(int argc, char *argv[], unsigned
|
Line 1493 rplinit(int argc, char *argv[], unsigned
|
|
|
if (option_n == d_vrai) |
if (option_n == d_vrai) |
{ |
{ |
# ifndef _BROKEN_SIGINFO |
action.sa_handler = interruption4; |
action.sa_sigaction = interruption10; |
action.sa_flags = SA_ONSTACK; |
# 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) |
{ |
{ |
Line 2013 rplinit(int argc, char *argv[], unsigned
|
Line 1888 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); |
Line 2917 rplinit(int argc, char *argv[], unsigned
|
Line 2794 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 2956 rplinit(int argc, char *argv[], unsigned
|
Line 2836 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 3079 rplinit(int argc, char *argv[], unsigned
|
Line 2960 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 3609 rplinit(int argc, char *argv[], unsigned
|
Line 3491 rplinit(int argc, char *argv[], unsigned
|
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 |
pthread_mutex_destroy(&mutex_liste_threads); |
sem_destroy(&semaphore_liste_threads); |
pthread_mutex_destroy(&mutex_gestionnaires_signaux_atomique); |
# else |
|
sem_destroy2(semaphore_liste_threads, sem_liste_threads); |
|
# endif |
|
# ifndef SEMAPHORES_NOMMES |
# 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 |
|
|
|
# ifdef _BROKEN_SIGINFO |
|
destruction_fifos_signaux(s_etat_processus); |
|
# undef return |
|
# endif |
# endif |
|
|
|
destruction_queue_signaux(s_etat_processus); |
liberation_contexte_cas(s_etat_processus); |
liberation_contexte_cas(s_etat_processus); |
|
|
free((*s_etat_processus).chemin_fichiers_temporaires); |
free((*s_etat_processus).chemin_fichiers_temporaires); |