*** empty log message ***

This commit is contained in:
glenux 2004-02-23 17:15:20 +00:00 committed by Glenn Y. Rolland
parent d67ad3940e
commit 27b4accdd9
3 changed files with 14 additions and 6 deletions

View file

@ -192,11 +192,19 @@ void * msgAllocate(msgSpace *space,
int bufferFreeSize;
bufferFreeSize=mSPoolDataTabAddr[selectedPoolIndex].bufferSize;
printf("BufferSize : %d", bufferFreeSize);
resultAddr = mmap( NULL,
// on mappe la totalité du pool
resultAddr = mmap( NULL,
bufferFreeSize,
PROT_READ | PROT_WRITE,
MAP_SHARED, mSPoolFd,
(off_t)0); // bufferFreeSize*bufferFreeIndex );
(off_t)0);
int bufferNb=mSPoolDataTabAddr[selectedPoolIndex].bufferNb;
mprotect(resultAddr,bufferFreeSize*bufferNb,PROT_NONE);
mprotect(resultAddr,bufferFreeSize*(bufferFreeIndex+1),PROT_READ|PROT_WRITE);
//(bufferFreeSize*bufferFreeIndex) );
if( resultAddr == MAP_FAILED) {
NZG_ERROR("resultAddr mmap","");
goto ERROR;

View file

@ -11,6 +11,7 @@ int msgBufferDetachProc(
msgBufferInfo * bufferInfoTabAddr;
int bufferInfoNb;
printf("Detaching %d,%d\n",poolIndex,bufferIndex);
//récuperer l'ID du BufferInfoTab;
strcpy(bufferInfoTabId, poolDataTabAddr[poolIndex].bufferInfoTabId);
@ -23,7 +24,7 @@ int msgBufferDetachProc(
/** on regarde dans le tableau d'infos de buffer **/
bufferInfoNb=poolDataTabAddr[poolIndex].bufferNb;
bufferInfoTabAddr=mmap(NULL,bufferInfoNb*sizeof(msgBufferInfo),
PROT_READ,MAP_SHARED,bufferInfoTabFd,(off_t)0);
PROT_READ|PROT_WRITE,MAP_SHARED,bufferInfoTabFd,(off_t)0);
bufferInfoTabAddr[bufferIndex].ownerPid = (pid_t)-1;
bufferInfoTabAddr[bufferIndex].addr = NULL;

View file

@ -1,7 +1,7 @@
#include "libnazgul.h"
int msgFree(msgSpace * space, void * addr){
printf("Freeee de :0x%08x\n",(int)addr);
printf("[ FREE 0x%08x ]\n",(int)addr);
int poolIndex;
int bufferIndex;
@ -59,8 +59,7 @@ sem_t * poolDataTabSemFd;
printf("Found : %d\n",err);
printf("Freing pool: %d, buffer: %d\n",poolIndex,bufferIndex);
//msgBufferDetachProc(poolDataTabAddr,poolIndex,bufferIndex,addr);
printf("FREE-SEMWAIT\n");
msgBufferDetachProc(poolDataTabAddr,poolIndex,bufferIndex,addr);
/* unmapper le msgPoolDataTab */
munmap(poolDataTabAddr,(space->poolNb) * sizeof( msgPoolData ));