c'est mieux comme ca...
This commit is contained in:
parent
99069ac389
commit
8bcb94ec42
2 changed files with 3 additions and 2 deletions
|
@ -186,14 +186,14 @@ void * msgAllocate(msgSpace *space,
|
|||
int bufferFreeSize;
|
||||
bufferFreeSize=mSPoolDataTabAddr[selectedPoolIndex].bufferSize;
|
||||
printf("BufferSize : %d", bufferFreeSize);
|
||||
|
||||
|
||||
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);
|
||||
bufferNb=mSPoolDataTabAddr[selectedPoolIndex].bufferNb;
|
||||
|
||||
// mprotect(resultAddr,bufferFreeSize*bufferNb,PROT_NONE);
|
||||
mprotect(resultAddr,bufferFreeSize*(bufferFreeIndex+1),PROT_READ|PROT_WRITE);
|
||||
|
|
|
@ -21,6 +21,7 @@ int msgPut(msgSpace * space,int queueIndex, void * addr){
|
|||
msgQueueId queueId;
|
||||
msgQueue * queue;
|
||||
msgQueueIdIntern(queueId,space->externId,queueIndex);
|
||||
|
||||
msgQueueProtLock(space->externId,queueIndex);
|
||||
queue = msgQueueOpen(queueId);
|
||||
|
||||
|
|
Loading…
Reference in a new issue