l3.libnazgul/src/spaceListElemCreate.c

35 lines
779 B
C
Raw Normal View History

2004-02-23 09:42:25 +00:00
#include "libnazgul.h"
#include "ids.h"
2004-02-23 09:42:25 +00:00
// cree un nouvel elemen
2004-02-24 08:57:52 +00:00
int msgSpaceListElemCreate(msgSpaceListElemId elemenListId,msgSpace * space){
int shmElemenList;
2004-02-24 08:57:52 +00:00
/*Creation de lid pour lespace de message*/
2004-02-24 08:57:52 +00:00
spaceListElemIdIntern(elemenListId,space->externId);
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;
};
2004-02-24 08:57:52 +00:00
close (shmElemenList);
2004-02-24 08:57:52 +00:00
//TODO: mapper le shm en m<>moire et remplir avec des informations
//strcpy(spaceListElem->spaceId,space->id);
2004-02-23 09:42:25 +00:00
return 0;
ERROR:
return-1;
2004-02-23 09:42:25 +00:00
};