version 1.1, 2011/12/05 19:35:54
|
version 1.7, 2012/03/01 10:14:07
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.5 |
RPL/2 (R) version 4.1.7 |
Copyright (C) 1989-2011 Dr. BERTRAND Joël |
Copyright (C) 1989-2012 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 38
|
Line 38
|
void |
void |
instruction_poll(struct_processus *s_etat_processus) |
instruction_poll(struct_processus *s_etat_processus) |
{ |
{ |
|
int erreur; |
int ios; |
int ios; |
int timeout; |
int timeout; |
|
|
Line 76 instruction_poll(struct_processus *s_eta
|
Line 77 instruction_poll(struct_processus *s_eta
|
printf(" Usage:\n\n"); |
printf(" Usage:\n\n"); |
} |
} |
|
|
printf(" FILE { \"POLLIN\" \"POLLOUT\" } TIMEOUT POLL\n"); |
printf(" FILE { \"POLLIN\" \"POLLOUT\" } TIMEOUT POLL\n\n"); |
printf(" 3: %s, %s\n", d_SCK, d_FCH); |
printf(" 3: %s, %s\n", d_SCK, d_FCH); |
printf(" 2: %s\n", d_LST); |
printf(" 2: %s\n", d_LST); |
printf(" 1: %s, %s\n", d_INT, d_REL); |
printf(" 1: %s, %s\n", d_INT, d_REL); |
Line 108 instruction_poll(struct_processus *s_eta
|
Line 109 instruction_poll(struct_processus *s_eta
|
if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile), |
if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile), |
&s_objet_argument_2) == d_erreur) |
&s_objet_argument_2) == d_erreur) |
{ |
{ |
liberation(s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
|
|
(*s_etat_processus).erreur_execution = d_ex_manque_argument; |
(*s_etat_processus).erreur_execution = d_ex_manque_argument; |
return; |
return; |
Line 117 instruction_poll(struct_processus *s_eta
|
Line 118 instruction_poll(struct_processus *s_eta
|
if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile), |
if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile), |
&s_objet_argument_3) == d_erreur) |
&s_objet_argument_3) == d_erreur) |
{ |
{ |
liberation(s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
|
|
(*s_etat_processus).erreur_execution = d_ex_manque_argument; |
(*s_etat_processus).erreur_execution = d_ex_manque_argument; |
return; |
return; |
Line 130 instruction_poll(struct_processus *s_eta
|
Line 131 instruction_poll(struct_processus *s_eta
|
if ((*s_objet_argument_3).type == SCK) |
if ((*s_objet_argument_3).type == SCK) |
{ |
{ |
s_poll.fd = (*((struct_socket *) |
s_poll.fd = (*((struct_socket *) |
(*s_objet_argument_1).objet)).socket; |
(*s_objet_argument_3).objet)).socket; |
} |
} |
else |
else |
{ |
{ |
s_poll.fd = (*((struct_fichier *) |
s_poll.fd = (*((struct_fichier *) |
(*s_objet_argument_1).objet)).descripteur; |
(*s_objet_argument_3).objet)).descripteur; |
} |
} |
|
|
if ((*s_objet_argument_2).type != LST) |
if ((*s_objet_argument_2).type != LST) |
Line 175 instruction_poll(struct_processus *s_eta
|
Line 176 instruction_poll(struct_processus *s_eta
|
{ |
{ |
s_poll.events |= POLLIN; |
s_poll.events |= POLLIN; |
} |
} |
else (strcmp(registre, "POLLOUT") == 0) |
else if (strcmp(registre, "POLLOUT") == 0) |
{ |
{ |
s_poll.events |= POLLOUT; |
s_poll.events |= POLLOUT; |
} |
} |
Line 218 instruction_poll(struct_processus *s_eta
|
Line 219 instruction_poll(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
if ((s_objet_resultat = allocation(s_etat_processus, INT)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
do |
do |
{ |
{ |
drapeau = d_vrai; |
drapeau = d_vrai; |
Line 254 instruction_poll(struct_processus *s_eta
|
Line 249 instruction_poll(struct_processus *s_eta
|
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_3); |
liberation(s_etat_processus, s_objet_argument_3); |
liberation(s_etat_processus, s_objet_resultat); |
|
|
|
(*s_etat_processus).erreur_execution = |
(*s_etat_processus).erreur_execution = |
d_ex_erreur_acces_fichier; |
d_ex_erreur_acces_fichier; |
Line 291 instruction_poll(struct_processus *s_eta
|
Line 285 instruction_poll(struct_processus *s_eta
|
} |
} |
} while(drapeau == d_faux); |
} while(drapeau == d_faux); |
|
|
|
if ((s_objet_resultat = allocation(s_etat_processus, INT)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
if (ios > 0) |
if (ios > 0) |
{ |
{ |
// Sortie sur un événement |
// Sortie sur un événement |