library/src/SharedMemoryAccess.h

21 lines
559 B
C

//
// Created by Cigerxwin Chaker on 05.11.19.
//
#ifndef LIBRARY_SHAREDMEMORYACCESSS_H
#define LIBRARY_SHAREDMEMORYACCESSS_H
#define PERM 0666 /* Zugriffsrechte */
#define LOCK -1
#define UNLOCK 1
#define SemKey 123458L
int memoryAccessKey; /* var type is int. but could be another type. */ //TODO: look after type in sharedmemory group
int semId;
struct sembuf semaphore;
int initSemaphore (void);
int semaphoreOperation (int op);
char* getShmPointer(void);
void writeToShm(char* text, int size);
#endif //LIBRARY_SHAREDMEMORYACCESSS_H