From 53d08b99dff3351f727a73692735a27179c66176 Mon Sep 17 00:00:00 2001 From: glenux Date: Sun, 22 Feb 2004 09:59:56 +0000 Subject: [PATCH] *** empty log message *** --- src/nzg_allocate.c | 18 +++++++++--------- src/nzg_buffer.c | 10 ++++++++++ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/nzg_allocate.c b/src/nzg_allocate.c index 42b6162..00e7f09 100644 --- a/src/nzg_allocate.c +++ b/src/nzg_allocate.c @@ -28,9 +28,9 @@ void * msgAllocate(msgSpace *space, sem_t * ressourceSemFd=NULL; int * ressourceSemVal=NULL; float minPoolCoef; - int selectedIdx; + int selectedPoolIndex; - selectedIdx=-1; + selectedPoolIndex=-1; /* TODO: verifier le premier arg du shm_open */ mSPoolDataTabFd=shm_open(space->poolDataTabId,O_RDWR,MSGSPACE_DEFAULT_MODE); @@ -90,7 +90,7 @@ void * msgAllocate(msgSpace *space, /* choisir la 1ere pool de taille plus grande * libre si possible */ gotRessourceSem=true; - selectedIdx=i; + selectedPoolIndex=i; break; } if( sem_close(ressourceSemFd) <0){ @@ -117,16 +117,16 @@ void * msgAllocate(msgSpace *space, /* il n'y a aucune pool dont la taille satisfait la demande */ return NULL; } else { - selectedIdx=idxPoolOptimum; + selectedPoolIndex=idxPoolOptimum; } } }else { - selectedIdx=pool; + selectedPoolIndex=pool; } if (!gotRessourceSem){ - strcpy(resultPoolId,mSPoolDataTab[selectedIdx].id); - msgPoolSemIdIntern(ressourceSemId,space->id,selectedIdx); + strcpy(resultPoolId,mSPoolDataTab[selectedPoolIndex].id); + msgPoolSemIdIntern(ressourceSemId,space->id,selectedPoolIndex); ressourceSemFd=sem_open(ressourceSemId,O_CREAT,SEM_DEFAULT_MODE,0); if(ressourceSemFd==SEM_FAILED){ perror("sem_open"); @@ -146,12 +146,12 @@ void * msgAllocate(msgSpace *space, /* on modifie maintenant les données */ /* - on récupere l'index du premier buffer libre */ - //TODO:int bufferFreeIndex = msgBufferGetFreeIndex(space,selectedIdx); + //TODO:int bufferFreeIndex = msgBufferGetFreeIndex(space,selectedPoolIndex); /*TODO: mapper le buffer libre dans l'esp addr du proc */ //TODO: /* - on s'enregistre aupres de ce buffer */ - //TODO: msgBufferAttachProc(space,selectedIdx,resultAddr); + //TODO: msgBufferAttachProc(space,selectedPoolIndex,resultAddr); sem_close(poolDataTabSemFd); diff --git a/src/nzg_buffer.c b/src/nzg_buffer.c index e69de29..6851883 100644 --- a/src/nzg_buffer.c +++ b/src/nzg_buffer.c @@ -0,0 +1,10 @@ +#include "libnazgul.h" +#include "nzg_ids.h" + +int msgBufferGetFreeIndex(msgSpaceId spaceId,int poolIndex){ + return -1; +} + +int msgBufferAttachProc(msgSpaceId spaceId,int poolIndex,void * addr){ + return -1; +}