diff --git a/src/nzg_allocate.c b/src/nzg_allocate.c index f6c0ed2..36c98d5 100644 --- a/src/nzg_allocate.c +++ b/src/nzg_allocate.c @@ -196,14 +196,14 @@ void * msgAllocate(msgSpace *space, // on mappe la totalité du pool resultAddr = mmap( NULL, bufferFreeSize, - PROT_READ | PROT_WRITE, + PROT_NONE, //prot PROT_READ | PROT_WRITE MAP_SHARED, mSPoolFd, (off_t)0); int 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,PROT_NONE); + //mprotect(resultAddr,bufferFreeSize*bufferFreeIndex,PROT_NONE); resultAddr=resultAddr +( bufferFreeSize*bufferFreeIndex); if( resultAddr == MAP_FAILED) { diff --git a/src/nzg_queueAdd.c b/src/nzg_queueAdd.c new file mode 100644 index 0000000..e69de29 diff --git a/src/nzg_queueAddElem.c b/src/nzg_queueAddElem.c new file mode 100644 index 0000000..e69de29 diff --git a/src/nzg_queueDelete.c b/src/nzg_queueDelete.c new file mode 100644 index 0000000..e69de29 diff --git a/src/nzg_queueInit.c b/src/nzg_queueInit.c new file mode 100644 index 0000000..e69de29 diff --git a/src/nzg_queueLock.c b/src/nzg_queueLock.c new file mode 100644 index 0000000..e69de29 diff --git a/src/nzg_queueRemElem.c b/src/nzg_queueRemElem.c new file mode 100644 index 0000000..e69de29 diff --git a/src/nzg_queueUnlock.c b/src/nzg_queueUnlock.c new file mode 100644 index 0000000..e69de29 diff --git a/test/create_delete.c b/test/create_delete.c index bb873a6..a50dc17 100644 --- a/test/create_delete.c +++ b/test/create_delete.c @@ -40,9 +40,11 @@ int main(void) { mSPAC=msgSpaceOpen(testId); montext=msgAllocate(mSPAC,2,280,0); *montext=42; - printf("### test Valeur %d ###\n",(int)*montext); + printf("### test Valeur0 %d ###\n",(int)*montext); sleep(2); montext=msgAllocate(mSPAC,2,270,0); + *montext=17; + printf("### test Valeur1 %d ###\n",(int)*montext); sleep(2); montext=msgAllocate(mSPAC,2,270,0); msgFree(mSPAC,(void *)montext);