dbTalk Databases Forums  

How to start Berkeley DB with vxWoks5.5?(always come error)

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss How to start Berkeley DB with vxWoks5.5?(always come error) in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default How to start Berkeley DB with vxWoks5.5?(always come error) - 05-10-2006 , 09:47 AM






hello
I worked under the VxWorks with Tornado2.2.In my workspace I opened
the BerkeleyDB22.wpj,to build the project to PENTIUM3gnu.Secondly I
created my own project and build this to PENTIUM3gnu too.All Building
is successfully,but when I run the test program it comes error.My
target is a Pc.

Would you like to tell me how to begin a simple application with
Berkeley DB using vxWorks5.5?

#include"sys/types.h"
#include"vxWorks.h"
#include"taskLib.h"
#include"stdio.h"
#include"stdlib.h"
#include"string.h"
#include"db.h"
#include"pthread.h"





#define DATABASE "host:F:/demo.db"

STATUS print_error(int ret)
{
if(ret!=0)
{
printf("ERROR:%s\n",db_strerror(ret));
}
}

STATUS db_function()
{
DB *dbp;
DBT key;
DBT data;
int ret;
FILE *fp;

memset(&key,0,sizeof(key));
memset(&data,0,sizeof(data));

key.data="sport";
key.size=strlen("sport")+1;
data.data="football";
data.size=strlen("football")+1;


ret=db_create(&dbp,NULL,0);
print_error(ret);

dbp->set_errfile(dbp, stderr);

ret=dbp->open(dbp,NULL,DATABASE,NULL,DB_BTREE,DB_CREATE,06 64);
print_error(ret);


logMsg("00 task is working\n",0,0,0,0,0,0);

ret=dbp->put(dbp,NULL,&key,&data,DB_NOOVERWRITE);
logMsg("01 task is working\n",0,0,0,0,0,0);
print_error(ret);

ret=dbp->get(dbp,NULL,&key,&data,0);
print_error(ret);
logMsg("02 task is working\n",0,0,0,0,0,0);

ret=dbp->close(dbp,0);
print_error(ret);


printf("OK\n");
logMsg("task is working\n",0,0,0,0,0,0);
}

ERROR from target:
host:F:/_dbdemo.tmp:errno=0xd0003
host:F:/demo.db:errno=0xd0003
close:errno=0xd0003
close:errno=0xd0003
0xfebbe18(s1u0):memPartFree:Invalid block 0xffff0f0 in Partition
0x3ab2f0


what'wrong?
Would you like to tell me how to start a simple application under
Tornado2.2 with Berkeley DB?Thanks a lot!!!


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.