From 6753d8269a80bcda42732912bdb98e87437e059c Mon Sep 17 00:00:00 2001 From: rivka_zan Date: Mon, 23 Feb 2004 22:19:28 +0000 Subject: [PATCH] * ajout la fonction spaceListElenCreate --- src/spaceListElemCreate.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/spaceListElemCreate.c b/src/spaceListElemCreate.c index f2221ab..10445dc 100644 --- a/src/spaceListElemCreate.c +++ b/src/spaceListElemCreate.c @@ -1,6 +1,30 @@ #include "libnazgul.h" +#include "ids.h" // cree un nouvel elemen -int msgSpaceListElemCreate(msgSpaceListElemId resultName,msgSpaceId spaceId){ +int msgSpaceListElemCreate(msgSpaceListElemId elemenListId,msgSpaceId spaceId){ + + int shmElemenList; + /*Creation de lid pour lespace de message*/ + + spaceListElemIdIntern(elemenListId,spaceId); + + + if ((shmElemenList=shm_open(elemenListId, + O_RDWR|O_CREAT|O_EXCL|O_TRUNC, + MSGSPACE_DEFAULT_MODE))==-1){ + NZG_ERROR("shm_open:Space list creation",elemenListId); + goto ERROR; + } + + if(ftruncate(shmElemenList,sizeof(elemenListId) ) <0) { + NZG_ERROR("ftruncate",elemenListId); + goto ERROR; + }; + close (shmElemenList); + return 0; +ERROR: + return-1; + };