deklarartion und definition der Ausgabe Shared Memory Segment id
This commit is contained in:
parent
e565c06550
commit
85b3cc67c5
|
@ -7,6 +7,11 @@ void shared_memory_init(){
|
||||||
memory_id = shmget(IPC_PRIVATE, SHMMAXSIZE, IPC_CREAT | IPC_EXCL);
|
memory_id = shmget(IPC_PRIVATE, SHMMAXSIZE, IPC_CREAT | IPC_EXCL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Shared-Memory-Segment id weiterreichen
|
||||||
|
int get_shared_memory_id(){
|
||||||
|
return memory_id;
|
||||||
|
}
|
||||||
|
|
||||||
//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(){
|
||||||
memory_id = shmctl(memory_id, IPC_RMID, 0);
|
memory_id = shmctl(memory_id, IPC_RMID, 0);
|
||||||
|
|
|
@ -14,6 +14,9 @@ extern int memory_id;
|
||||||
//Shared-Memory-Segment erstellen oder öffnen – shmget()
|
//Shared-Memory-Segment erstellen oder öffnen – shmget()
|
||||||
void shared_memory_init();
|
void shared_memory_init();
|
||||||
|
|
||||||
|
//Shared-Memory-Segment id weiterreichen
|
||||||
|
int get_shared_memory_id();
|
||||||
|
|
||||||
//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();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue