*** empty log message ***
This commit is contained in:
parent
8bcb94ec42
commit
4d535fd155
1 changed files with 9 additions and 19 deletions
|
@ -181,29 +181,19 @@ void * msgAllocate(msgSpace *space,
|
|||
strcpy(resultPoolId,mSPoolDataTabAddr[selectedPoolIndex].poolId);
|
||||
|
||||
|
||||
mSPoolFd=shm_open(resultPoolId,O_RDWR,MSGSPACE_DEFAULT_MODE);
|
||||
/* mSPoolFd=shm_open(resultPoolId,O_RDWR,MSGSPACE_DEFAULT_MODE); */
|
||||
|
||||
int bufferFreeSize;
|
||||
bufferFreeSize=mSPoolDataTabAddr[selectedPoolIndex].bufferSize;
|
||||
printf("BufferSize : %d", bufferFreeSize);
|
||||
<<<<<<< allocate.c
|
||||
|
||||
bufferNb=mSPoolDataTabAddr[selectedPoolIndex].bufferNb;
|
||||
// on mappe la totalité du pool
|
||||
resultAddr = mmap( NULL,
|
||||
bufferFreeSize*bufferNb, /* bufferFreeSize*/
|
||||
PROT_NONE, //prot PROT_READ | PROT_WRITE
|
||||
MAP_SHARED, mSPoolFd,
|
||||
(off_t)0);
|
||||
resultAddr=msgBufferMap(mSPoolDataTabAddr,selectedPoolIndex,bufferFreeIndex);
|
||||
if (resultAddr==NULL){
|
||||
NZG_ERROR("msgBufferMap",mSPoolDataTabAddr[selectedPoolIndex].poolId);
|
||||
goto ERROR;
|
||||
}
|
||||
|
||||
// mprotect(resultAddr,bufferFreeSize*bufferNb,PROT_NONE);
|
||||
mprotect(resultAddr,bufferFreeSize*(bufferFreeIndex+1),PROT_READ|PROT_WRITE);
|
||||
//mprotect(resultAddr,bufferFreeSize*bufferFreeIndex,PROT_NONE);
|
||||
resultAddr=resultAddr +( bufferFreeSize*bufferFreeIndex);
|
||||
|
||||
if( resultAddr == MAP_FAILED) {
|
||||
NZG_ERROR("resultAddr mmap","");
|
||||
goto ERROR;
|
||||
}
|
||||
|
||||
//TODO:
|
||||
/* - on s'enregistre aupres de ce buffer */
|
||||
|
@ -211,7 +201,7 @@ void * msgAllocate(msgSpace *space,
|
|||
selectedPoolIndex,
|
||||
bufferFreeIndex,
|
||||
resultAddr);
|
||||
close(mSPoolFd);
|
||||
/* close(mSPoolFd); */
|
||||
|
||||
msgPoolDataTabUnlock(space);
|
||||
|
||||
|
|
Loading…
Reference in a new issue