(example below)
                                                                                                  Last Revised: February 26, 2017
$ gcc Lab3.c -o Lab3 && ./Lab3 .. Lab3.c
 
File: ..
Directory: /root
You have general permissions: read execute
 
File: Lab3.c
Directory: /home/users15/sew25545
You have owner permissions: read write execute
 
 
Hint for Semaphores implemented as pipes:
 
void V(int pd[]) {
int a=1;
write(pd[1],&a,sizeof(int));
}
 
void P(int pd[]) {
int a;
read(pd[0],&a,sizeof(int));
}