From 06f708aee196015da77410894e8df30b4de4a17b Mon Sep 17 00:00:00 2001 From: glenux Date: Mon, 23 Feb 2004 21:16:05 +0000 Subject: [PATCH] *** empty log message *** --- src/queueElemCreate.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/queueElemCreate.c b/src/queueElemCreate.c index 1cad935..5c379e6 100644 --- a/src/queueElemCreate.c +++ b/src/queueElemCreate.c @@ -2,4 +2,26 @@ #include "ids.h" int msgQueueElemCreate(msgQueueId queueId,int counter){ + msgQueueElemId queueElemId; + + msgQueueElemIdIntern(queueElemId,queueId,counter); + + int queueElemFd; + queueElemFd=shm_open(queueElemId, + O_RDWR|O_CREAT|O_EXCL|O_TRUNC, + SHM_DEFAULT_MODE); + if (queueElemFd == -1 ) { + NZG_ERROR("shm_open : msgQueueElem creation",queueElemId); + goto ERROR; + } + + if (ftruncate(queueElemFd, sizeof(msgQueueElem)) < 0){ + NZG_ERROR("ftruncate", queueElemId); + goto ERROR; + } + + close(queueElem_Fd); + return 0; +ERROR: + return -1; }