#include #include #include #include #include "binary_sems.h" /* Declares our binary semaphore functions */ #include "mm.h" /* Declares our binary semaphore functions */ #define SEM_KEY 0x5678 #define OBJ_PERMS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP) /* Two semaphores are used to ensure exclusive, alternating access to the shared memory segment */ #define WRITE_SEM 0 /* Writer has access to shared memory */ #define READ_SEM 1 /* Reader has access to shared memory */ struct Item { int pic; int info; };