*** empty log message ***
This commit is contained in:
parent
8bdac0866a
commit
058832884c
3 changed files with 30 additions and 0 deletions
|
@ -75,6 +75,7 @@ typedef struct MsgQueueElem {
|
|||
} msgQueueElem;
|
||||
|
||||
typedef struct MsgQueue {
|
||||
msgQueueId id;
|
||||
int elemCounter;
|
||||
msgQueueElemId head;
|
||||
msgQueueElemId tail;
|
||||
|
|
0
src/queueClose.c
Normal file
0
src/queueClose.c
Normal file
29
src/queueOpen.c
Normal file
29
src/queueOpen.c
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include "libnazgul.h"
|
||||
#include "ids.h"
|
||||
|
||||
void * queueOpen(msgQueueId queueId){
|
||||
int queueFd;
|
||||
void * queueAddr;
|
||||
|
||||
queueFd=shm_open(queueId,O_RDWR,SHM_DEFAULT_MODE);
|
||||
if (queueFd == -1 ) {
|
||||
NZG_ERROR("shm_open : msgQueue open",queueId);
|
||||
goto ERROR;
|
||||
}
|
||||
|
||||
queueAddr=mmap(NULL,
|
||||
sizeof(msgQueue),
|
||||
PROT_READ|PROT_WRITE,
|
||||
MAP_SHARED,
|
||||
queueFd,
|
||||
0);
|
||||
if( queueAddr == MAP_FAILED ) {
|
||||
NZG_ERROR("mmap",queueId);
|
||||
goto ERROR;
|
||||
}
|
||||
|
||||
close(queueFd);
|
||||
return queueAddr;
|
||||
ERROR:
|
||||
return NULL;
|
||||
}
|
Loading…
Reference in a new issue