Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Question!


Name: Sleeping Barber
Title:
  Sleeping Barber
Question:
6     18     C:\Users\User\Desktop\Untitled2.cpp     [Error] sys/ipc: No such file or directory need help/ this is my program 








#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<pthread.h>
#include<errno.h>
#include<sys/ipc.h>
#include<semaphore.h>

#define N 5

time_t end_time;/*end time*/
sem_t mutex,customers,barbers;/*Three semaphors*/
int count=0;/*The number of customers waiting for haircuts*/
 
void barber(void *arg);
void customer(void *arg);
 
int main(int argc,char *argv[])
{
     pthread_t id1,id2;
     int status=0;
     end_time=time(NULL) 20;/*Barber Shop Hours is 20s*/
 
     /*Semaphore initialization*/
     sem_init(
Answers: