jfcmacro

BorrarSemFumadores.cpp

Mar 22nd, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <fcntl.h>           /* For O_* constants */
  2. #include <sys/stat.h>        /* For mode constants */
  3. #include <semaphore.h>
  4. #include <iostream>
  5. #include <cstdlib>
  6. #include <cstring>
  7. #include <cerrno>
  8. #include "nombres.h"
  9.  
  10. using namespace std;
  11.  
  12. int
  13. main(void) {
  14.  
  15.   for (int i = 0; i < nSEM; ++i) {
  16.     if (sem_unlink(nombres[i]) == -1) {
  17.       cerr << "Error borrando los semaforos: " << strerror(errno) << endl;
  18.     }
  19.   }
  20.  
  21.   return EXIT_SUCCESS;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment