Syntaktische korektur
This commit is contained in:
parent
b0f99af8d7
commit
8bdee40ef3
|
@ -1,25 +1,25 @@
|
||||||
#include "SharedMemory.h"
|
#include "SharedMemory.h"
|
||||||
|
|
||||||
//Shared-Memory-Segment erstellen oder öffnen – shmget()
|
//Shared-Memory-Segment erstellen oder öffnen – shmget()
|
||||||
void shared-memory-init(){
|
void shared_memory_init(){
|
||||||
memmory-id = shmget(IPC_PRIVATE, SHMMAXSIZE, IPC_CREAT | IPC_EXCL);
|
memory_id = shmget(IPC_PRIVATE, SHMMAXSIZE, IPC_CREAT | IPC_EXCL);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Ein Shared-Memory-Segment abfragen, ändern oder löschen – shmctl()
|
//Ein Shared-Memory-Segment abfragen, ändern oder löschen – shmctl()
|
||||||
void delet-shared-memory(){
|
void delet_shared_memory(){
|
||||||
int shmctl(memmory-id, IPC_RMID, 0);
|
int shmctl(memory_id, IPC_RMID, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Shared-Memory-Segment an einen Prozess anbinden (attach) – shmat()
|
//Shared-Memory-Segment an einen Prozess anbinden (attach) – shmat()
|
||||||
void attach-process(char *myProcess){
|
void attach_process(char *myProcess){
|
||||||
if(( myProcess = shmat( memmory-id, (char *)0, 0 )) < (char *)0 ){
|
if(( myProcess = shmat( memmory_id, (char *)0, 0 )) < (char *)0 ){
|
||||||
perror("Fehler beim Ankoppeln des gemeinsamen Speicher Segments");
|
perror("Fehler beim Ankoppeln des gemeinsamen Speicher Segments");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Ein Shared-Memory-Segment loslösen – shmdt()
|
//Ein Shared-Memory-Segment loslösen – shmdt()
|
||||||
void release-memory‚(){
|
void release_memory(){
|
||||||
int shmdt(void *myProcess);
|
int shmdt(void *myProcess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,21 +6,21 @@
|
||||||
#include <sys/shm.h>
|
#include <sys/shm.h>
|
||||||
|
|
||||||
//ID-Speicherbereich
|
//ID-Speicherbereich
|
||||||
#define int speicher-id
|
#define int memory_id
|
||||||
//Größe des Speicherbereichs hier 8MB (64bit)
|
//Größe des Speicherbereichs hier 8MB (64bit)
|
||||||
#define SHMMAXSIZE 64
|
#define SHMMAXSIZE 64
|
||||||
|
|
||||||
|
|
||||||
//Shared-Memory-Segment erstellen oder öffnen – shmget()
|
//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()
|
//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()
|
//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()
|
//Ein Shared-Memory-Segment loslösen – shmdt()
|
||||||
void release-memory();
|
void release_memory();
|
||||||
|
|
||||||
#endif //SHARED_MEMORY_H
|
#endif //SHARED_MEMORY_H
|
||||||
|
|
Loading…
Reference in New Issue