/** * * @File : exo_02c.cxx * * * @Author : A. Dragut * * @Synopsis : Producteur-Consommateur communicant * a travers une FIFO -- mkfifo() * **/ #include #include #include #include // getpid() #include // ENOENT, EEXIST #include // O_RDONLY #include "CExc.h" // exceptions fonctions systemes #include "nsSysteme.h" //appels systemes using namespace std; using namespace nsSysteme; //utilisation de la bibliotheque nsSysteme int main(int argc, char * argv []) { try { if (argc != 2) throw CExc("main()",string ("Usage : ") + argv [0] + " "); //on essaye de creer la FIFO si le producteur ne l'as pas deja fait //si elle est creee l'erreur systeme sera EEXIST //dans ce cas on va simplement continuer en l'utilisant //creation d'un fichier de type FIFO try { Mkfifo (argv [1], 0700); } catch (const CExc & Exc) { cerr <