version 1.37, 2011/06/20 17:54:20
|
version 1.52, 2011/09/26 15:57:16
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.0.prerelease.1 |
RPL/2 (R) version 4.1.4 |
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 262 instruction_wait(struct_processus *s_eta
|
Line 262 instruction_wait(struct_processus *s_eta
|
do |
do |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
# 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 |
# else |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# endif |
|
|
|
code_retour = nanosleep(&temporisation, &temporisation); |
code_retour = nanosleep(&temporisation, &temporisation); |
erreur = errno; |
erreur = errno; |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
# else |
# else |
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
Line 1413 instruction_write(struct_processus *s_et
|
Line 1409 instruction_write(struct_processus *s_et
|
/* |
/* |
* Sockets non formatées |
* Sockets non formatées |
*/ |
*/ |
|
|
|
chaine = NULL; |
} |
} |
else |
else |
{ |
{ |
Line 1458 instruction_write(struct_processus *s_et
|
Line 1456 instruction_write(struct_processus *s_et
|
} |
} |
|
|
# 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 |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (sigaction(SIGPIPE, ®istre, NULL) != 0) |
if (sigaction(SIGPIPE, ®istre, NULL) != 0) |
Line 1485 instruction_write(struct_processus *s_et
|
Line 1483 instruction_write(struct_processus *s_et
|
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
# else |
# else |
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
Line 1509 instruction_write(struct_processus *s_et
|
Line 1507 instruction_write(struct_processus *s_et
|
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
# else |
# else |
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
Line 1566 instruction_write(struct_processus *s_et
|
Line 1564 instruction_write(struct_processus *s_et
|
d_code_fin_chaine; |
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) |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
# else |
# else |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*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_unix, sizeof(adresse_unix)) < 0) |
&adresse_unix, sizeof(adresse_unix)) < 0) |
{ |
{ |
|
ios = errno; |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
.semaphore_fork)) == -1) |
!= 0) |
# else |
# else |
while(sem_wait((*s_etat_processus) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
.semaphore_fork) == -1) |
|
# endif |
# 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 1613 instruction_write(struct_processus *s_et
|
Line 1607 instruction_write(struct_processus *s_et
|
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
# else |
# else |
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
Line 1644 instruction_write(struct_processus *s_et
|
Line 1638 instruction_write(struct_processus *s_et
|
adresse_ipv4.sin_addr.s_addr = htonl(calcul_adresse); |
adresse_ipv4.sin_addr.s_addr = htonl(calcul_adresse); |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
if (sem_post(&((*s_etat_processus) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) |
.semaphore_fork)) != 0) |
!= 0) |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
# else |
# else |
if (sem_post((*s_etat_processus) .semaphore_fork) != 0) |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*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, |
Line 1664 instruction_write(struct_processus *s_et
|
Line 1654 instruction_write(struct_processus *s_et
|
&adresse_ipv4, sizeof(adresse_ipv4)) < 0) |
&adresse_ipv4, sizeof(adresse_ipv4)) < 0) |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus) |
while(sem_wait(&((*s_etat_processus) |
.semaphore_fork)) == -1) |
.semaphore_fork)) != 0) |
# else |
# else |
while(sem_wait((*s_etat_processus) |
while(sem_wait((*s_etat_processus) |
.semaphore_fork) == -1) |
.semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
Line 1685 instruction_write(struct_processus *s_et
|
Line 1675 instruction_write(struct_processus *s_et
|
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
.semaphore_fork)) == -1) |
!= 0) |
# else |
# else |
while(sem_wait((*s_etat_processus) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
.semaphore_fork) == -1) |
|
# endif |
# 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 1733 instruction_write(struct_processus *s_et
|
Line 1721 instruction_write(struct_processus *s_et
|
adresse[i], i++); |
adresse[i], i++); |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
if (sem_post(&((*s_etat_processus) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) |
.semaphore_fork)) != 0) |
!= 0) |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
# else |
# else |
if (sem_post((*s_etat_processus) .semaphore_fork) != 0) |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*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, |
Line 1753 instruction_write(struct_processus *s_et
|
Line 1737 instruction_write(struct_processus *s_et
|
&adresse_ipv6, sizeof(adresse_ipv6)) < 0) |
&adresse_ipv6, sizeof(adresse_ipv6)) < 0) |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus) |
while(sem_wait(&((*s_etat_processus) |
.semaphore_fork)) == -1) |
.semaphore_fork)) != 0) |
# else |
# else |
while(sem_wait((*s_etat_processus) |
while(sem_wait((*s_etat_processus) |
.semaphore_fork) == -1) |
.semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
Line 1774 instruction_write(struct_processus *s_et
|
Line 1758 instruction_write(struct_processus *s_et
|
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
.semaphore_fork)) == -1) |
!= 0) |
# else |
# else |
while(sem_wait((*s_etat_processus) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
.semaphore_fork) == -1) |
|
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
Line 1984 instruction_wflock(struct_processus *s_e
|
Line 1967 instruction_wflock(struct_processus *s_e
|
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
# 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 |
# else |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# endif |
|
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
# else |
# else |
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
Line 2224 instruction_wfproc(struct_processus *s_e
|
Line 2203 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 2311 instruction_wfproc(struct_processus *s_e
|
Line 2290 instruction_wfproc(struct_processus *s_e
|
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
# 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 |
# else |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# endif |
|
|
|
nanosleep(&attente, NULL); |
nanosleep(&attente, NULL); |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
# else |
# else |
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
Line 2582 instruction_wfdata(struct_processus *s_e
|
Line 2559 instruction_wfdata(struct_processus *s_e
|
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
# 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 |
# else |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# endif |
|
|
|
nanosleep(&attente, NULL); |
nanosleep(&attente, NULL); |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
# else |
# else |
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
Line 2788 instruction_wfsock(struct_processus *s_e
|
Line 2763 instruction_wfsock(struct_processus *s_e
|
drapeau = d_vrai; |
drapeau = d_vrai; |
|
|
# ifndef SEMAPHORES_NOMMES |
# 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 |
# else |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
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 2809 instruction_wfsock(struct_processus *s_e
|
Line 2780 instruction_wfsock(struct_processus *s_e
|
erreur = errno; |
erreur = errno; |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
# else |
# else |
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
Line 2845 instruction_wfsock(struct_processus *s_e
|
Line 2817 instruction_wfsock(struct_processus *s_e
|
else |
else |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
# else |
# else |
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
Line 2887 instruction_wfsock(struct_processus *s_e
|
Line 2860 instruction_wfsock(struct_processus *s_e
|
drapeau = d_vrai; |
drapeau = d_vrai; |
|
|
# ifndef SEMAPHORES_NOMMES |
# 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 |
# else |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
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 2908 instruction_wfsock(struct_processus *s_e
|
Line 2877 instruction_wfsock(struct_processus *s_e
|
erreur = errno; |
erreur = errno; |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
# else |
# else |
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
Line 2944 instruction_wfsock(struct_processus *s_e
|
Line 2914 instruction_wfsock(struct_processus *s_e
|
else |
else |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
# else |
# else |
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
Line 3005 instruction_wfsock(struct_processus *s_e
|
Line 2976 instruction_wfsock(struct_processus *s_e
|
drapeau = d_vrai; |
drapeau = d_vrai; |
|
|
# ifndef SEMAPHORES_NOMMES |
# 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 |
# else |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
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 3025 instruction_wfsock(struct_processus *s_e
|
Line 2992 instruction_wfsock(struct_processus *s_e
|
erreur = errno; |
erreur = errno; |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
# else |
# else |
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
Line 3061 instruction_wfsock(struct_processus *s_e
|
Line 3029 instruction_wfsock(struct_processus *s_e
|
else |
else |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
# else |
# else |
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
Line 3351 instruction_wfpoke(struct_processus *s_e
|
Line 3320 instruction_wfpoke(struct_processus *s_e
|
do |
do |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
# 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 |
# else |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# endif |
|
|
|
nanosleep(&attente, NULL); |
nanosleep(&attente, NULL); |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
# else |
# else |
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
Line 3513 instruction_wfack(struct_processus *s_et
|
Line 3478 instruction_wfack(struct_processus *s_et
|
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
# 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 |
# else |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
# endif |
|
|
|
nanosleep(&attente, NULL); |
nanosleep(&attente, NULL); |
INCR_GRANULARITE(attente.tv_nsec); |
INCR_GRANULARITE(attente.tv_nsec); |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
# else |
# else |
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |