• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src/router/db-4.8.30/docs/programmer_reference/
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml">
4  <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6    <title>VxWorks FAQ</title>
7    <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
8    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9    <link rel="start" href="index.html" title="Berkeley DB Programmer's Reference Guide" />
10    <link rel="up" href="build_vxworks.html" title="Chapter 30.  Building Berkeley DB for VxWorks" />
11    <link rel="prev" href="build_vxworks_notes.html" title="VxWorks notes" />
12    <link rel="next" href="upgrade.html" title="Chapter 31.  Upgrading from previous versions of Berkeley DB" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">VxWorks FAQ</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="build_vxworks_notes.html">Prev</a> </td>
22          <th width="60%" align="center">Chapter 30. 
23		Building Berkeley DB for VxWorks
24        </th>
25          <td width="20%" align="right"> <a accesskey="n" href="upgrade.html">Next</a></td>
26        </tr>
27      </table>
28      <hr />
29    </div>
30    <div class="sect1" lang="en" xml:lang="en">
31      <div class="titlepage">
32        <div>
33          <div>
34            <h2 class="title" style="clear: both"><a id="build_vxworks_faq"></a>VxWorks FAQ</h2>
35          </div>
36        </div>
37      </div>
38      <div class="orderedlist">
39        <p>The third problem is that all tasks will hang on a dosFs semaphore.  You should
40look at <span class="bold"><strong>SPR 72063</strong></span> in the Wind River Systems' Support pages for
41a more detailed description of this problem.</p>
42        <ol type="1">
43          <li>
44            <span class="bold">
45              <strong>I get the error "Workspace open failed: This project workspace is an
46older format.", when trying to open the supplied workspace on Tornado 2.0
47under Windows.</strong>
48            </span>
49            <p>This error will occur if the files were extracted in a manner that adds
50a CR/LF to lines in the file.  Make sure that you download the Berkeley DB
51".zip" version of the Berkeley DB distribution, and, when extracting the Berkeley DB
52sources, that you use an unzipper program that will not do any
53conversion.</p>
54          </li>
55          <li>
56            <span class="bold">
57              <strong>I sometimes see spurious output errors about temporary directories.</strong>
58            </span>
59            <p>These messages are coming from the <code class="literal">stat</code>(2) function call
60in VxWorks.  Unlike other systems, there may not be a well known
61temporary directory on the target.  Therefore, we highly recommend that
62all applications use <a href="../api_reference/C/envset_tmp_dir.html" class="olink">DB_ENV-&gt;set_tmp_dir()</a> to
63specify a temporary directory for the application.</p>
64          </li>
65          <li>
66            <span class="bold">
67              <strong>How can I build Berkeley DB without using Tornado?</strong>
68            </span>
69            <p>The simplest way to build Berkeley DB without using Tornado is to configure
70Berkeley DB on a UNIX system, and then use the Makefile and include files
71generated by that configuration as the starting point for your build.
72The Makefile and include files are created during configuration, in the
73current directory, based on your configuration decisions (for example,
74debugging vs.  non-debugging builds), so you'll need to configure the
75system for the way you want Berkeley DB to be built.</p>
76            <p>Additionally, you'll need to account for the slight difference between
77the set of source files used in a UNIX build and the set used in a
78VxWorks build.  You can use the following command to create a list of
79the Berkeley DB VxWorks files.  The commands assume you are in the build_vxworks
80directory of the Berkeley DB distribution:</p>
81            <pre class="programlisting">% cat &gt; /tmp/files.sed
82s/&lt;BEGIN&gt; FILE_//
83s/_objects//
84^D
85% grep FILE_ BerkeleyDB.wpj | grep _objects | sed -f /tmp/files.sed &gt; /tmp/db.files</pre>
86            <p>You will then have a template Makefile and include files, and a list of
87VxWorks-specific source files.  You will need to convert this Makefile
88and list of files into a form that is acceptable to your specific build
89environment.</p>
90          </li>
91          <li>
92            <span class="bold">
93              <strong>Does Berkeley DB use floating point registers?</strong>
94            </span>
95            <p>Yes, there are a few places in Berkeley DB where floating point computations
96are performed.  As a result, all applications that call
97<span class="emphasis"><em>taskSpawn</em></span> should specify the <span class="bold"><strong>VX_FP_TASK</strong></span> option.</p>
98          </li>
99          <li>
100            <span class="bold">
101              <strong>Can I run the test suite under VxWorks?</strong>
102            </span>
103            <p>The test suite requires the Berkeley DB Tcl library.  In turn, this library
104requires Tcl 8.4 or greater.  In order to run the test suite, you would
105need to port Tcl 8.4 or greater to VxWorks.  The Tcl shell included in
106<span class="emphasis"><em>windsh</em></span> is not adequate for two reasons.  First, it is based on
107Tcl 8.0.  Second, it does not include the necessary Tcl components for
108adding a Tcl extension.</p>
109          </li>
110          <li>
111            <span class="bold">
112              <strong>Are all Berkeley DB features available for VxWorks?</strong>
113            </span>
114            <p>All Berkeley DB features are available for VxWorks with the exception of the
115<a href="../api_reference/C/dbopen.html#open_DB_TRUNCATE" class="olink">DB_TRUNCATE</a> flag for <a href="../api_reference/C/dbopen.html" class="olink">DB-&gt;open()</a>.  The underlying mechanism
116needed for that flag is not available consistently across different file
117systems for VxWorks.</p>
118          </li>
119          <li>
120            <span class="bold">
121              <strong>Are there any constraints using particular filesystem drivers?</strong>
122            </span>
123            <p>There are constraints using the dosFs filesystems with Berkeley DB.  Namely,
124you must configure your dosFs filesystem to support long filenames if
125you are using Berkeley DB logging in your application.  The VxWorks' dosFs
1261.0 filesystem, by default, uses the old MS-DOS 8.3 file-naming
127constraints, restricting to 8 character filenames with a 3 character
128extension.  If you have configured with VxWorks' dosFs 2.0 you should
129be compatible with Windows FAT32 filesystems which supports long
130filenames.</p>
131          </li>
132          <li>
133            <span class="bold">
134              <strong>Are there any dependencies on particular filesystem drivers?</strong>
135            </span>
136            <p>There is one dependency on specifics of filesystem drivers in the port
137of Berkeley DB to VxWorks.  Berkeley DB synchronizes data using the FIOSYNC function
138to ioctl() (another option would have been to use the FIOFLUSH function
139instead).  The FIOSYNC function was chosen because the NFS client driver,
140nfsDrv, only supports it and doesn't support FIOFLUSH.  All local file
141systems, as of VxWorks 5.4, support FIOSYNC -- with the exception of
142rt11fsLib, which only supports FIOFLUSH.  To use rt11fsLib, you will need
143to modify the os/os_fsync.c file to use the FIOFLUSH function; note that
144rt11fsLib cannot work with NFS clients.</p>
145          </li>
146          <li>
147            <span class="bold">
148              <strong>Are there any known filesystem problems?</strong>
149            </span>
150            <p>During the course of our internal testing, we came across three problems
151with the dosFs 2.0 filesystem that warranted patches from Wind River Systems.
152We strongly recommend you upgrade to dosFs 2.2, <span class="bold"><strong>SPR 79795 (x86)</strong></span>
153and <span class="bold"><strong>SPR 79569 (PPC)</strong></span> which fixes all of these problems and
154many more.  You should ask Wind River Systems for the patches to these
155problems if you encounter them and are unable to upgrade to dosFs 2.2.</p>
156            <p>The first problem is that files will seem to disappear.  You should
157look at <span class="bold"><strong>SPR 31480</strong></span> in the Wind River Systems' Support pages for
158a more detailed description of this problem.</p>
159            <p>The second problem is a semaphore deadlock within the dosFs filesystem
160code.  Looking at a stack trace via CrossWind, you will see two or more of
161your application's tasks waiting in semaphore code within dosFs.  The patch
162for this problem is under <span class="bold"><strong>SPR 33221</strong></span> at Wind River Systems.
163There are several SPR numbers at Wind River Systems that refer to this
164particular problem.</p>
165          </li>
166          <li>
167            <span class="bold">
168              <strong>Are there any filesystems I cannot use?</strong>
169            </span>
170            <p>Currently both the Target Server File System (TSFS) and NFS are not able
171to be used.</p>
172            <p>The Target Server File System (TSFS) uses the netDrv driver.  This driver
173does not support any ioctl that allows flushing to the disk, nor does
174it allow renaming of files via FIORENAME.
175The NFS file system uses nfsDrv and that driver
176does not support FIORENAME and cannot be used
177with Berkeley DB.  </p>
178          </li>
179          <li>
180            <span class="bold">
181              <strong>What VxWorks primitives are used for mutual exclusion in Berkeley DB?</strong>
182            </span>
183            <p>Mutexes inside of Berkeley DB use the basic binary semaphores in VxWorks.  The
184mutexes are created using the FIFO queue type.</p>
185          </li>
186          <li>
187            <span class="bold">
188              <strong>What are the implications of VxWorks' mutex implementation
189using microkernel resources?</strong>
190            </span>
191            <p>On VxWorks, the semaphore primitives implementing mutexes consume system
192resources.  Therefore, if an application unexpectedly fails, those
193resources could leak.  Berkeley DB solves this problem by always allocating
194mutexes in the persistent shared memory regions.  Then, if an
195application fails, running recovery or explicitly removing the database
196environment by calling the <a href="../api_reference/C/envremove.html" class="olink">DB_ENV-&gt;remove()</a> method will allow Berkeley DB to
197release those previously held mutex resources.  If an application
198specifies the <a href="../api_reference/C/envopen.html#open_DB_PRIVATE" class="olink">DB_PRIVATE</a> flag (choosing not to use persistent
199shared memory), and then fails, mutexes allocated in that private memory
200may leak their underlying system resources.  Therefore, the
201<a href="../api_reference/C/envopen.html" class="olink">DB_ENV-&gt;open()</a> flag should be used with caution on VxWorks.</p>
202          </li>
203        </ol>
204      </div>
205    </div>
206    <div class="navfooter">
207      <hr />
208      <table width="100%" summary="Navigation footer">
209        <tr>
210          <td width="40%" align="left"><a accesskey="p" href="build_vxworks_notes.html">Prev</a> </td>
211          <td width="20%" align="center">
212            <a accesskey="u" href="build_vxworks.html">Up</a>
213          </td>
214          <td width="40%" align="right"> <a accesskey="n" href="upgrade.html">Next</a></td>
215        </tr>
216        <tr>
217          <td width="40%" align="left" valign="top">VxWorks notes </td>
218          <td width="20%" align="center">
219            <a accesskey="h" href="index.html">Home</a>
220          </td>
221          <td width="40%" align="right" valign="top"> Chapter 31. 
222		Upgrading from previous versions of Berkeley DB
223        </td>
224        </tr>
225      </table>
226    </div>
227  </body>
228</html>
229