jfcmacro icon

BorrarSemFumadores.cpp

jfcmacro | PRO | 03/22/19 04:52:26 PM UTC | 0 ⭐ | 421 👁️ | Never ⏰ | []
C++ |

440 B

|

None

|

0 👍

/

0 👎

#include <fcntl.h>           /* For O_* constants */
#include <sys/stat.h>        /* For mode constants */
#include <semaphore.h>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cerrno>
#include "nombres.h"
 
using namespace std;
 
int
main(void) {
 
  for (int i = 0; i < nSEM; ++i) {
    if (sem_unlink(nombres[i]) == -1) {
      cerr << "Error borrando los semaforos: " << strerror(errno) << endl;
    }
  }
 
  return EXIT_SUCCESS;
}

Comments