version 1.17, 2010/08/13 21:00:37
|
version 1.21, 2010/09/02 07:51:48
|
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 241 localisation_courante(struct_processus *
|
Line 241 localisation_courante(struct_processus *
|
|
|
verrouillage_threads_concurrents(s_etat_processus); |
verrouillage_threads_concurrents(s_etat_processus); |
pid = fork(); |
pid = fork(); |
|
|
# ifdef OS2 |
|
if (pid == 0) |
|
{ |
|
sem_init(&semaphore_liste_threads, 0, 1); |
|
sem_init(&semaphore_gestionnaires_signaux, 0, 0); |
|
sem_init(&semaphore_gestionnaires_signaux_atomique, 0, 1); |
|
sem_init(&((*s_etat_processus).semaphore_fork), 0, 0); |
|
} |
|
# endif |
|
|
|
deverrouillage_threads_concurrents(s_etat_processus); |
deverrouillage_threads_concurrents(s_etat_processus); |
|
|
pthread_sigmask(SIG_SETMASK, &oldset, NULL); |
pthread_sigmask(SIG_SETMASK, &oldset, NULL); |
Line 472 localisation_courante(struct_processus *
|
Line 461 localisation_courante(struct_processus *
|
return; |
return; |
} |
} |
|
|
|
tampon[0] = d_code_fin_chaine; |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
# else |
# else |
Line 607 localisation_courante(struct_processus *
|
Line 598 localisation_courante(struct_processus *
|
{ |
{ |
// Le processus fils renvoie une erreur. |
// Le processus fils renvoie une erreur. |
|
|
# ifndef SEMAPHORES_NOMMES |
free(tampon); |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
|
# else |
if (((*s_etat_processus).localisation = malloc((strlen(d_locale) |
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
+ 1) * sizeof(unsigned char))) == NULL) |
# endif |
|
{ |
{ |
if (errno != EINTR) |
(*s_etat_processus).erreur_systeme = d_es_processus; |
{ |
return; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
} |
} |
|
|
(*s_etat_processus).erreur_execution = d_ex_erreur_processus; |
strcpy((*s_etat_processus).localisation, d_locale); |
return; |
|
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
Line 817 tex_fprintf(struct_processus *s_etat_pro
|
Line 803 tex_fprintf(struct_processus *s_etat_pro
|
return(ios); |
return(ios); |
} |
} |
|
|
|
#undef readline |
|
|
|
unsigned char * |
|
readline_wrapper(unsigned char *invite) |
|
{ |
|
unsigned char *chaine; |
|
|
|
chaine = readline(invite); |
|
printf("\r"); |
|
|
|
return(chaine); |
|
} |
|
|
|
|
#define fprintf NULL |
#define fprintf NULL |
#define printf NULL |
#define printf NULL |
|
|