This commit is contained in:
stormrider1982 2004-02-19 21:07:57 +00:00
parent 13bb480903
commit 7d2ac0ca87
2 changed files with 25 additions and 2 deletions

View file

@ -55,3 +55,26 @@ int msgSpacePoolId2nzgPoolId(msgSpacePoolId dest,msgSpacePoolId src, int num){
// //donne l'adr en mappant in the memory // //donne l'adr en mappant in the memory
//poolAddr = mmap(NULL, sizeof(*msgPool), PROT_NONE, MAP_SHARED, poolFd, 0); //poolAddr = mmap(NULL, sizeof(*msgPool), PROT_NONE, MAP_SHARED, poolFd, 0);
msgPool * msgPoolAllocate(int poolFd, msgSpace *msg) {
msgPool * poolAddr;
int dataId;
//msgSpacePoolData spoolData;
//dataId = msg->poolDataId;
//spoolData[dataId];
//donne l'adr en mappant in the memory
poolAddr = mmap(NULL, sizeof(*msgPool), PROT_NONE, MAP_SHARED, poolFd, 0);
if(poolAddr == MAP_FAILED) {
fprintf( stderr, "mmap failed: %s\n",
strerror( errno ) );
return NULL;
}
// on renvoie le pointeur sur le bon pool
return poolAddr;
}