-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhead.h
More file actions
32 lines (24 loc) · 710 Bytes
/
head.h
File metadata and controls
32 lines (24 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*--- DEFINE ---*/
#define SEMAPHORE_OCCUPIED "/SEMAPHORE_OCCUPIED"
#define SEMAPHORE_ZERO "/SEMAPHORE_ZERO"
#define FILENAME "write.c"
#define IPC_REST_ERROR (-1)
/*--- COMMON LIBRARIES ---*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h> /* getopt */
#include <sys/shm.h> /* shmget, shmat */
#include <sys/types.h> /* ftok, shmat */
#include <sys/ipc.h> /* ftok */
#include <fcntl.h> /* sem_open */
#include <sys/stat.h> /* sem_open */
#include <errno.h> /* errno */
#include <semaphore.h> /* sem_open, sem_wait, sem_post */
int option;
char *p;
int ringBufferSize;
char *addressSpace;
char *addressSpaceHead;
char *addressSpaceTail;
key_t key;