2004-02-23 09:42:25 +00:00
|
|
|
#include "libnazgul.h"
|
2004-02-23 22:19:28 +00:00
|
|
|
#include "ids.h"
|
2004-02-23 09:42:25 +00:00
|
|
|
|
|
|
|
// cree un nouvel elemen
|
2004-02-23 22:19:28 +00:00
|
|
|
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);
|
|
|
|
|
2004-02-23 09:42:25 +00:00
|
|
|
return 0;
|
2004-02-23 22:19:28 +00:00
|
|
|
ERROR:
|
|
|
|
return-1;
|
|
|
|
|
2004-02-23 09:42:25 +00:00
|
|
|
};
|