From 7307556d7029789f15c66a7341748feceafcea8b Mon Sep 17 00:00:00 2001 From: glenux Date: Sun, 22 Feb 2004 22:00:23 +0000 Subject: [PATCH] *** empty log message *** --- test/create_delete.c | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/test/create_delete.c b/test/create_delete.c index c942b61..5972bdf 100644 --- a/test/create_delete.c +++ b/test/create_delete.c @@ -1,3 +1,4 @@ +#include #include "libnazgul.h" int main(void) { @@ -21,10 +22,38 @@ int main(void) { printf("RequestedId: %s\n",testId); mSPAC=msgSpaceCreate(testId,0,3,poolInfos); + + pid_t pid=fork(); - montext=msgAllocate(mSPAC,ANYPOOL,270,0); -// msgFree(mSPAC,(void *)montext); - msgSpaceDelete(testId); - + + + if (pid ==0){ + mSPAC=msgSpaceOpen(testId); + sleep(2); + montext=msgAllocate(mSPAC,2,180,0); + printf("ALLOC %d.. ok\n",(int)getpid()); + sleep(2); + montext=msgAllocate(mSPAC,2,170,0); + printf("ALLOC %d.. ok\n",(int)getpid()); + sleep(2); + montext=msgAllocate(mSPAC,2,270,0); + printf("ALLOC %d.. ok\n",(int)getpid()); + + } else { + mSPAC=msgSpaceOpen(testId); + montext=msgAllocate(mSPAC,2,280,0); + printf("ALLOC %d.. ok\n",(int)getpid()); + sleep(2); + montext=msgAllocate(mSPAC,2,270,0); + printf("ALLOC %d.. ok\n",(int)getpid()); + sleep(2); + montext=msgAllocate(mSPAC,2,270,0); + printf("ALLOC %d.. ok\n",(int)getpid()); + //msgFree(mSPAC,(void *)montext); + //msgFree(mSPAC,(void *)montext); + //msgFree(mSPAC,(void *)montext); + wait(NULL); + msgSpaceDelete(testId); + } return 0; }