1<!--$Id: qnx.so,v 11.12 2008/01/07 02:29:19 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: QNX</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 UNIX/POSIX systems</dl></b></td>
14<td align=right><a href="/build_unix/osf1.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/build_unix/sco.html"><img src="/images/next.gif" alt="Next"></a>
15</td></tr></table>
16<p align=center><b>QNX</b></p>
17<ol>
18<p><li><b>To what versions of QNX has DB been ported?</b>
19<p>Berkeley DB has been ported to the QNX Neutrino technology which is commonly
20referred to as QNX RTP (Real-Time Platform).  Berkeley DB has not been
21ported to earlier versions of QNX, such as QNX 4.25.</p>
22<p><li><b>Building Berkeley DB shared libraries fails.</b>
23<p>The <b>/bin/sh</b> utility distributed with some QNX releases drops
24core when running the GNU libtool script (which is used to build Berkeley DB
25shared libraries).  There are two workarounds for this problem: First,
26only build static libraries.  You can disable building shared libraries
27by specifying the <a name="--disable-shared">--disable-shared</a> configuration flag when
28configuring Berkeley DB.</p>
29<p>Second, build Berkeley DB using an alternate shell.  QNX distributions include
30an accessories disk with additional tools.  One of the included tools
31is the GNU bash shell, which is able to run the libtool script.  To
32build Berkeley DB using an alternate shell, move <b>/bin/sh</b> aside, link
33or copy the alternate shell into that location, configure, build and
34install Berkeley DB, and then replace the original shell utility.</p>
35<p><li><b>Are there any QNX filesystem issues?</b>
36<p>Berkeley DB generates temporary files for use in transactionally
37protected file system operations.  Due to the filename length limit of
3848 characters in the QNX filesystem, applications that are using
39transactions should specify a database name that is at most 43 characters.</p>
40<p><li><b>What are the implications of QNX's requirement to use
41<b>shm_open</b>(2) in order to use <b>mmap</b>(2)?</b>
42<p>QNX requires that files mapped with <b>mmap</b>(2) be opened using
43<b>shm_open</b>(2).  There are other places in addition to the
44environment shared memory regions, where Berkeley DB tries to memory map files
45if it can.</p>
46<p>The memory pool subsystem normally attempts to use <b>mmap</b>(2)
47even when using private memory, as indicated by the <a href="/api_c/env_open.html#DB_PRIVATE">DB_PRIVATE</a>
48flag to <a href="/api_c/env_open.html">DB_ENV-&gt;open</a>.  In the case of QNX, if an application is
49using private memory, Berkeley DB will not attempt to map the memory and will
50instead use the local cache.</p>
51<p><li><b>What are the implications of QNX's mutex implementation using
52microkernel resources?</b>
53<p>On QNX, the primitives implementing mutexes consume system resources.
54Therefore, if an application unexpectedly fails, those resources could
55leak.  Berkeley DB solves this problem by always allocating mutexes in the
56persistent shared memory regions.  Then, if an application fails,
57running recovery or explicitly removing the database environment by
58calling the <a href="/api_c/env_remove.html">DB_ENV-&gt;remove</a> method will allow Berkeley DB to release those
59previously held mutex resources.  If an application specifies the
60<a href="/api_c/env_open.html#DB_PRIVATE">DB_PRIVATE</a> flag (choosing not to use persistent shared memory),
61and then fails, mutexes allocated in that private memory may leak their
62underlying system resources.  Therefore, the <a href="/api_c/env_open.html#DB_PRIVATE">DB_PRIVATE</a> flag
63should be used with caution on QNX.</p>
64</ol>
65<table width="100%"><tr><td><br></td><td align=right><a href="/build_unix/osf1.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/build_unix/sco.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