*** empty log message ***

This commit is contained in:
glenux 2004-02-23 20:54:09 +00:00 committed by Glenn Y. Rolland
parent c0a30e0977
commit 48e22ffd7d
2 changed files with 44 additions and 0 deletions

15
src/queueElemClose.c Normal file
View file

@ -0,0 +1,15 @@
#include "libnazgul.h"
int msgQueueElemClose(msgQueueElem * queueElem){
msgQueueElemId qId;
strcpy(qId,queueElem->id);
if (munmap(queueElem,sizeof(msgQueueElem)) < 0){
NZG_ERROR("unmap",qId);
goto ERROR;
}
return 0;
ERROR:
return -1;
}

29
src/queueElemOpen.c Normal file
View file

@ -0,0 +1,29 @@
#include "libnazgul.h"
#include "ids.h"
void * msgQueueElemOpen(msgQueueElemId queueElemId){
int queueElemFd;
void * queueElemAddr;
queueElemFd=shm_open(queueElemId,O_RDWR,SHM_DEFAULT_MODE);
if (queueElemFd == -1 ) {
NZG_ERROR("shm_open : msgQueue open",queueElemId);
goto ERROR;
}
queueElemAddr=mmap(NULL,
sizeof(msgQueueElem),
PROT_READ|PROT_WRITE,
MAP_SHARED,
queueElemFd,
0);
if( queueElemAddr == MAP_FAILED ) {
NZG_ERROR("mmap",queueElemId);
goto ERROR;
}
close(queueElemFd);
return queueElemAddr;
ERROR:
return NULL;
}