/* ================================================================================ RPL/2 (R) version 4.1.5 Copyright (C) 1989-2011 Dr. BERTRAND Joël This file is part of RPL/2. RPL/2 is free software; you can redistribute it and/or modify it under the terms of the CeCILL V2 License as published by the french CEA, CNRS and INRIA. RPL/2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL V2 License for more details. You should have received a copy of the CeCILL License along with RPL/2. If not, write to info@cecill.info. ================================================================================ */ #include "rpl-conv.h" /* ================================================================================ Fonction 'restart' ================================================================================ Entrées : pointeur sur une structure struct_processus -------------------------------------------------------------------------------- Sorties : -------------------------------------------------------------------------------- Effets de bord : néant ================================================================================ */ void instruction_restart(struct_processus *s_etat_processus) { struct timespec attente; (*s_etat_processus).erreur_execution = d_ex; if ((*s_etat_processus).affichage_arguments == 'Y') { printf("\n RESTART "); if ((*s_etat_processus).langue == 'F') { printf("(réinitialisation du programme)\n\n"); printf(" Aucun argument\n"); } else { printf("(program reinitialization)\n\n"); printf(" No argument\n"); } return; } else if ((*s_etat_processus).test_instruction == 'Y') { (*s_etat_processus).nombre_arguments = -1; return; } if (test_cfsf(s_etat_processus, 31) == d_vrai) { if (empilement_pile_last(s_etat_processus, 0) == d_erreur) { return; } } envoi_signal_processus((*s_etat_processus).pid_processus_pere, rpl_sigabort); (*s_etat_processus).requete_arret = 'Y'; attente.tv_sec = 0; attente.tv_nsec = GRANULARITE_us * 1000; while((*s_etat_processus).var_volatile_requete_arret == 0) { scrutation_interruptions(s_etat_processus); nanosleep(&attente, NULL); INCR_GRANULARITE(attente.tv_nsec); } if ((*s_etat_processus).traitement_instruction_halt == d_vrai) { (*s_etat_processus).execution_pas_suivant = d_vrai; } (*s_etat_processus).requete_redemarrage = d_vrai; return; } // vim: ts=4