version 1.37, 2011/06/20 17:54:20
|
version 1.50, 2011/09/20 09:51:43
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.0.prerelease.1 |
RPL/2 (R) version 4.1.3 |
Copyright (C) 1989-2011 Dr. BERTRAND Joël |
Copyright (C) 1989-2011 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
Line 261 instruction_wait(struct_processus *s_eta
|
Line 261 instruction_wait(struct_processus *s_eta
|
|
|
do |
do |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
# endif |
|
|
|
code_retour = nanosleep(&temporisation, &temporisation); |
code_retour = nanosleep(&temporisation, &temporisation); |
erreur = errno; |
erreur = errno; |
|
|
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 1413 instruction_write(struct_processus *s_et
|
Line 1401 instruction_write(struct_processus *s_et
|
/* |
/* |
* Sockets non formatées |
* Sockets non formatées |
*/ |
*/ |
|
|
|
chaine = NULL; |
} |
} |
else |
else |
{ |
{ |
Line 1457 instruction_write(struct_processus *s_et
|
Line 1447 instruction_write(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
|
{ |
{ |
if (sigaction(SIGPIPE, ®istre, NULL) != 0) |
if (sigaction(SIGPIPE, ®istre, NULL) != 0) |
{ |
{ |
Line 1484 instruction_write(struct_processus *s_et
|
Line 1470 instruction_write(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 1508 instruction_write(struct_processus *s_et
|
Line 1490 instruction_write(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 1565 instruction_write(struct_processus *s_et
|
Line 1543 instruction_write(struct_processus *s_et
|
adresse_unix.sun_path[UNIX_PATH_MAX - 1] = |
adresse_unix.sun_path[UNIX_PATH_MAX - 1] = |
d_code_fin_chaine; |
d_code_fin_chaine; |
|
|
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
# endif |
|
|
|
if (sendto((*((struct_socket *) |
if (sendto((*((struct_socket *) |
(*s_objet_argument_1).objet)).socket, chaine, |
(*s_objet_argument_1).objet)).socket, chaine, |
longueur_effective, 0, (struct sockaddr *) |
longueur_effective, 0, (struct sockaddr *) |
&adresse_unix, sizeof(adresse_unix)) < 0) |
&adresse_unix, sizeof(adresse_unix)) < 0) |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
ios = errno; |
while(sem_wait(&((*s_etat_processus) |
|
.semaphore_fork)) == -1) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
# else |
|
while(sem_wait((*s_etat_processus) |
|
.semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = d_es_processus; |
d_es_processus; |
|
return; |
return; |
} |
} |
} |
} |
Line 1612 instruction_write(struct_processus *s_et
|
Line 1577 instruction_write(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 1643 instruction_write(struct_processus *s_et
|
Line 1604 instruction_write(struct_processus *s_et
|
adresse_ipv4.sin_port = htons(port); |
adresse_ipv4.sin_port = htons(port); |
adresse_ipv4.sin_addr.s_addr = htonl(calcul_adresse); |
adresse_ipv4.sin_addr.s_addr = htonl(calcul_adresse); |
|
|
# ifndef SEMAPHORES_NOMMES |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
if (sem_post(&((*s_etat_processus) |
|
.semaphore_fork)) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
# else |
|
if (sem_post((*s_etat_processus) .semaphore_fork) != 0) |
|
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# endif |
|
|
|
if (sendto((*((struct_socket *) |
if (sendto((*((struct_socket *) |
(*s_objet_argument_1).objet)).socket, chaine, |
(*s_objet_argument_1).objet)).socket, chaine, |
longueur_effective, 0, (struct sockaddr *) |
longueur_effective, 0, (struct sockaddr *) |
&adresse_ipv4, sizeof(adresse_ipv4)) < 0) |
&adresse_ipv4, sizeof(adresse_ipv4)) < 0) |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
|
while(sem_wait(&((*s_etat_processus) |
while(sem_wait(&((*s_etat_processus) |
.semaphore_fork)) == -1) |
.semaphore_fork)) != 0) |
# else |
|
while(sem_wait((*s_etat_processus) |
|
.semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 1684 instruction_write(struct_processus *s_et
|
Line 1631 instruction_write(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus) |
|
.semaphore_fork)) == -1) |
|
# else |
|
while(sem_wait((*s_etat_processus) |
|
.semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = d_es_processus; |
d_es_processus; |
|
return; |
return; |
} |
} |
} |
} |
Line 1732 instruction_write(struct_processus *s_et
|
Line 1672 instruction_write(struct_processus *s_et
|
adresse_ipv6.sin6_addr.s6_addr[i] = |
adresse_ipv6.sin6_addr.s6_addr[i] = |
adresse[i], i++); |
adresse[i], i++); |
|
|
# ifndef SEMAPHORES_NOMMES |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
if (sem_post(&((*s_etat_processus) |
|
.semaphore_fork)) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
# else |
|
if (sem_post((*s_etat_processus) .semaphore_fork) != 0) |
|
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# endif |
|
|
|
if (sendto((*((struct_socket *) |
if (sendto((*((struct_socket *) |
(*s_objet_argument_1).objet)).socket, chaine, |
(*s_objet_argument_1).objet)).socket, chaine, |
longueur_effective, 0, (struct sockaddr *) |
longueur_effective, 0, (struct sockaddr *) |
&adresse_ipv6, sizeof(adresse_ipv6)) < 0) |
&adresse_ipv6, sizeof(adresse_ipv6)) < 0) |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
|
while(sem_wait(&((*s_etat_processus) |
while(sem_wait(&((*s_etat_processus) |
.semaphore_fork)) == -1) |
.semaphore_fork)) != 0) |
# else |
|
while(sem_wait((*s_etat_processus) |
|
.semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 1773 instruction_write(struct_processus *s_et
|
Line 1699 instruction_write(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus) |
|
.semaphore_fork)) == -1) |
|
# else |
|
while(sem_wait((*s_etat_processus) |
|
.semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 1983 instruction_wflock(struct_processus *s_e
|
Line 1903 instruction_wflock(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
# endif |
|
|
|
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 2224 instruction_wfproc(struct_processus *s_e
|
Line 2132 instruction_wfproc(struct_processus *s_e
|
if ((*(*((struct_processus_fils *) (*(*l_element_courant) |
if ((*(*((struct_processus_fils *) (*(*l_element_courant) |
.donnee).objet)).thread).processus_detache == d_vrai) |
.donnee).objet)).thread).processus_detache == d_vrai) |
{ |
{ |
if (kill((*(*((struct_processus_fils *) |
if (envoi_signal_processus((*(*((struct_processus_fils *) |
(*(*l_element_courant).donnee).objet)).thread).pid, |
(*(*l_element_courant).donnee).objet)).thread).pid, |
0) != 0) |
rpl_signull) != 0) |
{ |
{ |
drapeau_fin = d_vrai; |
drapeau_fin = d_vrai; |
} |
} |
Line 2310 instruction_wfproc(struct_processus *s_e
|
Line 2218 instruction_wfproc(struct_processus *s_e
|
registre_instruction_valide; |
registre_instruction_valide; |
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
# endif |
|
|
|
nanosleep(&attente, NULL); |
nanosleep(&attente, NULL); |
|
|
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 2581 instruction_wfdata(struct_processus *s_e
|
Line 2477 instruction_wfdata(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
# endif |
|
|
|
nanosleep(&attente, NULL); |
nanosleep(&attente, NULL); |
|
|
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 2787 instruction_wfsock(struct_processus *s_e
|
Line 2671 instruction_wfsock(struct_processus *s_e
|
{ |
{ |
drapeau = d_vrai; |
drapeau = d_vrai; |
|
|
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
# endif |
|
|
|
if (((*((struct_socket *) (*s_objet_resultat).objet)).socket = |
if (((*((struct_socket *) (*s_objet_resultat).objet)).socket = |
accept((*((struct_socket *) (*s_objet_argument).objet)) |
accept((*((struct_socket *) (*s_objet_argument).objet)) |
Line 2808 instruction_wfsock(struct_processus *s_e
|
Line 2684 instruction_wfsock(struct_processus *s_e
|
{ |
{ |
erreur = errno; |
erreur = errno; |
|
|
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 2844 instruction_wfsock(struct_processus *s_e
|
Line 2716 instruction_wfsock(struct_processus *s_e
|
} |
} |
else |
else |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 2886 instruction_wfsock(struct_processus *s_e
|
Line 2754 instruction_wfsock(struct_processus *s_e
|
{ |
{ |
drapeau = d_vrai; |
drapeau = d_vrai; |
|
|
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
# endif |
|
|
|
if (((*((struct_socket *) (*s_objet_resultat).objet)).socket = |
if (((*((struct_socket *) (*s_objet_resultat).objet)).socket = |
accept((*((struct_socket *) (*s_objet_argument).objet)) |
accept((*((struct_socket *) (*s_objet_argument).objet)) |
Line 2907 instruction_wfsock(struct_processus *s_e
|
Line 2767 instruction_wfsock(struct_processus *s_e
|
{ |
{ |
erreur = errno; |
erreur = errno; |
|
|
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 2943 instruction_wfsock(struct_processus *s_e
|
Line 2799 instruction_wfsock(struct_processus *s_e
|
} |
} |
else |
else |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 3004 instruction_wfsock(struct_processus *s_e
|
Line 2856 instruction_wfsock(struct_processus *s_e
|
{ |
{ |
drapeau = d_vrai; |
drapeau = d_vrai; |
|
|
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
# endif |
|
|
|
if (((*((struct_socket *) (*s_objet_resultat).objet)).socket = |
if (((*((struct_socket *) (*s_objet_resultat).objet)).socket = |
accept((*((struct_socket *) (*s_objet_argument).objet)) |
accept((*((struct_socket *) (*s_objet_argument).objet)) |
Line 3024 instruction_wfsock(struct_processus *s_e
|
Line 2868 instruction_wfsock(struct_processus *s_e
|
{ |
{ |
erreur = errno; |
erreur = errno; |
|
|
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 3060 instruction_wfsock(struct_processus *s_e
|
Line 2900 instruction_wfsock(struct_processus *s_e
|
} |
} |
else |
else |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 3350 instruction_wfpoke(struct_processus *s_e
|
Line 3186 instruction_wfpoke(struct_processus *s_e
|
|
|
do |
do |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
# endif |
|
|
|
nanosleep(&attente, NULL); |
nanosleep(&attente, NULL); |
|
|
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 3512 instruction_wfack(struct_processus *s_et
|
Line 3336 instruction_wfack(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
# endif |
|
|
|
nanosleep(&attente, NULL); |
nanosleep(&attente, NULL); |
INCR_GRANULARITE(attente.tv_nsec); |
INCR_GRANULARITE(attente.tv_nsec); |
|
|
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
|
# endif |
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |