c'est mieux comme ca...
This commit is contained in:
parent
d7030895ab
commit
1aa93c9e9a
2 changed files with 3 additions and 2 deletions
|
@ -187,13 +187,13 @@ void * msgAllocate(msgSpace *space,
|
||||||
bufferFreeSize=mSPoolDataTabAddr[selectedPoolIndex].bufferSize;
|
bufferFreeSize=mSPoolDataTabAddr[selectedPoolIndex].bufferSize;
|
||||||
printf("BufferSize : %d", bufferFreeSize);
|
printf("BufferSize : %d", bufferFreeSize);
|
||||||
|
|
||||||
|
bufferNb=mSPoolDataTabAddr[selectedPoolIndex].bufferNb;
|
||||||
// on mappe la totalité du pool
|
// on mappe la totalité du pool
|
||||||
resultAddr = mmap( NULL,
|
resultAddr = mmap( NULL,
|
||||||
bufferFreeSize*bufferNb, /* bufferFreeSize*/
|
bufferFreeSize*bufferNb, /* bufferFreeSize*/
|
||||||
PROT_NONE, //prot PROT_READ | PROT_WRITE
|
PROT_NONE, //prot PROT_READ | PROT_WRITE
|
||||||
MAP_SHARED, mSPoolFd,
|
MAP_SHARED, mSPoolFd,
|
||||||
(off_t)0);
|
(off_t)0);
|
||||||
bufferNb=mSPoolDataTabAddr[selectedPoolIndex].bufferNb;
|
|
||||||
|
|
||||||
// mprotect(resultAddr,bufferFreeSize*bufferNb,PROT_NONE);
|
// mprotect(resultAddr,bufferFreeSize*bufferNb,PROT_NONE);
|
||||||
mprotect(resultAddr,bufferFreeSize*(bufferFreeIndex+1),PROT_READ|PROT_WRITE);
|
mprotect(resultAddr,bufferFreeSize*(bufferFreeIndex+1),PROT_READ|PROT_WRITE);
|
||||||
|
|
|
@ -21,6 +21,7 @@ int msgPut(msgSpace * space,int queueIndex, void * addr){
|
||||||
msgQueueId queueId;
|
msgQueueId queueId;
|
||||||
msgQueue * queue;
|
msgQueue * queue;
|
||||||
msgQueueIdIntern(queueId,space->externId,queueIndex);
|
msgQueueIdIntern(queueId,space->externId,queueIndex);
|
||||||
|
|
||||||
msgQueueProtLock(space->externId,queueIndex);
|
msgQueueProtLock(space->externId,queueIndex);
|
||||||
queue = msgQueueOpen(queueId);
|
queue = msgQueueOpen(queueId);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue