<!--$Id: qnx.html,v 1.2 2004/03/30 01:22:47 jtownsen Exp $--> <!--Copyright 1997-2003 by Sleepycat Software, Inc.--> <!--All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> <head> <title>Berkeley DB Reference Guide: QNX</title> <meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> <meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> </head> <body bgcolor=white> <a name="2"><!--meow--></a> <table width="100%"><tr valign=top> <td><h3><dl><dt>Berkeley DB Reference Guide:<dd>Building Berkeley DB for UNIX/POSIX systems</dl></h3></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> </td></tr></table> <p> <h3 align=center>QNX</h3> <ol> <p><li><b>To what versions of QNX has DB been ported?</b> <p>Berkeley DB has been ported to the QNX Neutrino technology which is commonly referred to as QNX RTP (Real-Time Platform). Berkeley DB has not been ported to earlier versions of QNX, such as QNX 4.25.</p> <p><li><b>Are there any QNX filesystem issues?</b> <p>Berkeley DB generates temporary files for use in transactionally protected file system operations. Due to the filename length limit of 48 characters in the QNX filesystem, applications that are using transactions should specify a database name that is at most 43 characters.</p> <p><li><b>What is the impact of QNX's use of <b>shm_open</b>(2) for shared memory regions?</b> <p>QNX requires the use of the POSIX <b>shm_open</b>(2) and <b>shm_unlink</b>(2) calls for shared memory regions that will later be mapped into memory using <b>mmap</b>(2). QNX's implementation of the shared memory functions requires that the name given must begin with a slash, and that no other slash may appear in the name.</p> <p>In order to comply with those requirements and allow relative pathnames to find the same environment, Berkeley DB uses only the last component of the home directory path and the name of the shared memory file, separated by a colon, as the name specified to the shared memory functions. For example, if an application specifies a home directory of <b>/home/db/DB_DIR</b>, Berkeley DB will use <b>/DB_DIR:__db.001</b> as the name for the shared memory area argument to <b>shm_open</b>(2).</p> <p>The impact of this decision is that the last component of all environment home directory pathnames on QNX must be unique with respect to each other. Additionally, Berkeley DB requires that environments use home directories for QNX in order to generate a reasonable entry in the shared memory area.</p> <p><li><b>What are the implications of QNX's requirement to use <b>shm_open</b>(2) in order to use <b>mmap</b>(2)?</b> <p>QNX requires that files mapped with <b>mmap</b>(2) be opened using <b>shm_open</b>(2). There are other places in addition to the environment shared memory regions, where Berkeley DB tries to memory map files if it can.</p> <p>The memory pool subsystem normally attempts to use <b>mmap</b>(2) even when using private memory, as indicated by the <a href="../../api_c/env_open.html#DB_PRIVATE">DB_PRIVATE</a> flag to <a href="../../api_c/env_open.html">DB_ENV->open</a>. In the case of QNX, if an application is using private memory, Berkeley DB will not attempt to map the memory and will instead use the local cache.</p> <p><li><b>What are the implications of QNX's mutex implementation using microkernel resources?</b> <p>On QNX, the primitives implementing mutexes consume system resources. Therefore, if an application unexpectedly fails, those resources could leak. Berkeley DB solves this problem by always allocating mutexes in the persistent shared memory regions. Then, if an application fails, running recovery or explicitly removing the database environment by calling the <a href="../../api_c/env_remove.html">DB_ENV->remove</a> method will allow Berkeley DB to release those previously held mutex resources. If an application specifies the <a href="../../api_c/env_open.html#DB_PRIVATE">DB_PRIVATE</a> flag (choosing not to use persistent shared memory), and then fails, mutexes allocated in that private memory may leak their underlying system resources. Therefore, the <a href="../../api_c/env_open.html#DB_PRIVATE">DB_PRIVATE</a> flag should be used with caution on QNX.</p> </ol> <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> </td></tr></table> <p><font size=1><a href="../../sleepycat/legal.html">Copyright (c) 1996-2003</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font> </body> </html>