/* * Project 3 - Shared memory and semaphores. * Dr. Silaghi's Operating System Concepts. * common.h - Common header file shared between daemon and client apps. * By Michael Rywalt - 2569 */ #ifndef _COMMON_H_ #define _COMMON_H_ #include "memory.h" #include "semaphore.h" /* Variables used for critical section. */ extern int iSemaphoreId; extern struct sembuf WaitMutex; extern struct sembuf SignalMutex; #define PROJECT "Project3" #define PROJECT_KEY "/tmp" #define PROJECT_ID 'M' /* Daemon exit error codes. */ #define EXIT_OK (0) #define EXIT_ERROR (1) /* * If we're being compiled against the daemon, * set up the following definitions. */ #ifdef PROJECT_DAEMON #ifndef EXIT #define EXIT DestroyDaemon #endif /* * Otherwise, if we're being compiled against * the client application, or any other, set up * the following definitions. */ #else #ifndef EXIT #define EXIT exit #endif #endif #endif /* _COMMON_H_ */