1<!--$Id: notes.so,v 1.22 2008/02/21 03:14:49 david Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB Reference Guide: VxWorks notes</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<a name="2"><!--meow--></a> 12<table width="100%"><tr valign=top> 13<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Building Berkeley DB for VxWorks systems</dl></b></td> 14<td align=right><a href="../build_vxworks/intro6x.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../build_vxworks/faq.html"><img src="../../images/next.gif" alt="Next"></a> 15</td></tr></table> 16<p align=center><b>VxWorks notes</b></p> 17<p>Berkeley DB currently disallows the <a href="../../api_c/db_open.html#DB_TRUNCATE">DB_TRUNCATE</a> flag to the 18<a href="../../api_c/db_open.html">DB->open</a> method on VxWorks because the operations this flag represents 19are not fully supported under VxWorks.</p> 20<p>The <a href="../../api_c/db_sync.html">DB->sync</a> method is implemented using an ioctl call into the file 21system driver with the FIOSYNC command. Most, but not all file system 22drivers support this call. Berkeley DB requires the use of a file system 23that supports FIOSYNC.</p> 24<b>Building and Running the Demo Program</b> 25<p>The demo program should be built in a manner very similar to building 26Berkeley DB. If you want different or additional BSP build specifications you 27should add them by following the directions indicated in 28<a href="../../ref/build_vxworks/intro.html">Building with Tornado 2.0 or 29Tornado 2.2</a>.</p> 30<p>The demo program can be downloaded and run by calling the entry function 31<b>dbdemo</b> with the pathname of a database to use. The demo 32program will ask for some input keys. It creates a database and adds 33those keys into the database, using the reverse of the key as the data 34value. When complete you can either enter EOF (control-D) or 35<b>quit</b> and the demo program will display all of the key/data 36items in the database.</p> 37<b>Building and Running the Utility Programs</b> 38<p>The Berkeley DB <a href="../../utility/index.html">utility programs</a> 39can be downloaded and run by calling the 40function equivalent to the utility's name. The utility functions take 41a string containing all the supported arguments. The program will then 42decompose that string into a traditional argc/argv used internally. 43For example, to execute <a href="../../utility/db_stat.html">db_stat</a> on a database within an 44environment you would execute the following from the windsh prompt. 45Obviously you would change the pathname and database name to reflect 46your system.</p> 47<blockquote><pre>-> db_stat "-h /tmp/myenvhome -d mydatabase.db"</pre></blockquote> 48<b>VxWorks 5.4/5.5: shared memory</b> 49<p>The memory on VxWorks is always resident and fully shared among all 50tasks running on the target. For this reason, the <a href="../../api_c/env_open.html#DB_LOCKDOWN">DB_LOCKDOWN</a> 51flag has no effect and the <a href="../../api_c/env_open.html#DB_SYSTEM_MEM">DB_SYSTEM_MEM</a> flag is implied for any 52application that does not specify the <a href="../../api_c/env_open.html#DB_PRIVATE">DB_PRIVATE</a> flag. Note 53that the <a href="../../api_c/env_open.html#DB_SYSTEM_MEM">DB_SYSTEM_MEM</a> flag requires all applications use a 54segment ID to ensure the applications do not overwrite each other's 55database environments: see the <a href="../../api_c/env_set_shm_key.html">DB_ENV->set_shm_key</a> method for more 56information.</p> 57<b>VxWorks 5.4/5.5: building a small memory footprint library</b> 58<p>A default small footprint build is provided. This default provides 59equivalent to the <b>--enable-smallbuild</b> configuration option 60described in <a href="../../ref/build_unix/small.html">Building a 61small memory footprint library</a>. In order to build the small 62footprint, you should move <b>db_config.h</b> aside and copy 63<b>db_config_small.h</b> to <b>db_config.h</b>. Then open up 64the appropriate small workspace file via Tornado and build as usual.</p> 65<table width="100%"><tr><td><br></td><td align=right><a href="../build_vxworks/intro6x.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../build_vxworks/faq.html"><img src="../../images/next.gif" alt="Next"></a> 66</td></tr></table> 67<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 68</body> 69</html> 70