From 8bdee40ef3ddf7d99d8190e40c299776eecccc77 Mon Sep 17 00:00:00 2001 From: "@Nurullah.Damla" Date: Wed, 23 Oct 2019 11:53:07 +0200 Subject: [PATCH] Syntaktische korektur --- src/SharedMemory.cpp | 14 +++++++------- src/SharedMemory.h | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/SharedMemory.cpp b/src/SharedMemory.cpp index 8d89064..367b123 100644 --- a/src/SharedMemory.cpp +++ b/src/SharedMemory.cpp @@ -1,25 +1,25 @@ #include "SharedMemory.h" //Shared-Memory-Segment erstellen oder öffnen – shmget() -void shared-memory-init(){ - memmory-id = shmget(IPC_PRIVATE, SHMMAXSIZE, IPC_CREAT | IPC_EXCL); +void shared_memory_init(){ + memory_id = shmget(IPC_PRIVATE, SHMMAXSIZE, IPC_CREAT | IPC_EXCL); } //Ein Shared-Memory-Segment abfragen, ändern oder löschen – shmctl() -void delet-shared-memory(){ - int shmctl(memmory-id, IPC_RMID, 0); +void delet_shared_memory(){ + int shmctl(memory_id, IPC_RMID, 0); } //Shared-Memory-Segment an einen Prozess anbinden (attach) – shmat() -void attach-process(char *myProcess){ - if(( myProcess = shmat( memmory-id, (char *)0, 0 )) < (char *)0 ){ +void attach_process(char *myProcess){ + if(( myProcess = shmat( memmory_id, (char *)0, 0 )) < (char *)0 ){ perror("Fehler beim Ankoppeln des gemeinsamen Speicher Segments"); exit(-1); } } //Ein Shared-Memory-Segment loslösen – shmdt() -void release-memory‚(){ +void release_memory(){ int shmdt(void *myProcess); } diff --git a/src/SharedMemory.h b/src/SharedMemory.h index a4f4fa9..74eca9b 100644 --- a/src/SharedMemory.h +++ b/src/SharedMemory.h @@ -6,21 +6,21 @@ #include //ID-Speicherbereich -#define int speicher-id +#define int memory_id //Größe des Speicherbereichs hier 8MB (64bit) #define SHMMAXSIZE 64 //Shared-Memory-Segment erstellen oder öffnen – shmget() -void shared-memory-init(); +void shared_memory_init(); //Ein Shared-Memory-Segment abfragen, ändern oder löschen – shmctl() -void delet-shared-memory(); +void delet_shared_memory(); //Shared-Memory-Segment an einen Prozess anbinden (attach) – shmat() -void attach-process(char *myProcess); +void attach_process(char *myProcess); //Ein Shared-Memory-Segment loslösen – shmdt() -void release-memory(); +void release_memory(); #endif //SHARED_MEMORY_H