From f4b6e7d65ab7ac916241bb4038a5ad76f01a63f1 Mon Sep 17 00:00:00 2001 From: glenux Date: Mon, 23 Feb 2004 18:27:27 +0000 Subject: [PATCH] *** empty log message *** --- src/nzg_allocate.c | 6 +++--- src/nzg_queueAdd.c | 0 src/nzg_queueAddElem.c | 0 src/nzg_queueDelete.c | 0 src/nzg_queueInit.c | 0 src/nzg_queueLock.c | 0 src/nzg_queueRemElem.c | 0 src/nzg_queueUnlock.c | 0 test/create_delete.c | 4 +++- 9 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 src/nzg_queueAdd.c create mode 100644 src/nzg_queueAddElem.c create mode 100644 src/nzg_queueDelete.c create mode 100644 src/nzg_queueInit.c create mode 100644 src/nzg_queueLock.c create mode 100644 src/nzg_queueRemElem.c create mode 100644 src/nzg_queueUnlock.c 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);