hpux.html   [plain text]


<!--$Id: hpux.so,v 11.17 2004/08/13 03:38:59 bostic Exp $-->
<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB Reference Guide: HP-UX</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,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><b><dl><dt>Berkeley DB Reference Guide:<dd>Building Berkeley DB for UNIX/POSIX systems</dl></b></td>
<td align=right><a href="../build_unix/freebsd.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/irix.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p align=center><b>HP-UX</b></p>
<ol>
<p><li><b>I can't specify the <a href="../../api_c/env_open.html#DB_SYSTEM_MEM">DB_SYSTEM_MEM</a> flag to <a href="../../api_c/env_open.html">DB_ENV-&gt;open</a>.</b>
<p>The <b>shmget</b>(2) interfaces are not always used on HP-UX, even
though they exist, because anonymous memory allocated using <b>shmget</b>(2)
cannot be used to store the standard HP-UX msemaphore semaphores.  For
this reason, it may not be possible to specify the <a href="../../api_c/env_open.html#DB_SYSTEM_MEM">DB_SYSTEM_MEM</a>
flag on some versions of HP-UX.  (We have seen this problem only on HP-UX
10.XX, so the simplest workaround may be to upgrade your HP-UX release.)</p>
<hr size=1 noshade>
<p><li><b>I can't specify both the <a href="../../api_c/env_open.html#DB_PRIVATE">DB_PRIVATE</a> and <a href="../../api_c/env_open.html#DB_THREAD">DB_THREAD</a>
flags to <a href="../../api_c/env_open.html">DB_ENV-&gt;open</a>.</b>
<p>It is not possible to store the standard HP-UX msemaphore semaphores in
memory returned by <b>malloc</b>(3) in some versions of HP-UX.  For
this reason, it may not be possible to specify both the
<a href="../../api_c/env_open.html#DB_PRIVATE">DB_PRIVATE</a> and <a href="../../api_c/env_open.html#DB_THREAD">DB_THREAD</a> flags on some versions of
HP-UX.  (We have seen this problem only on HP-UX 10.XX, so the simplest
workaround may be to upgrade your HP-UX release.)</p>
<hr size=1 noshade>
<p><li><b>I can't compile and run multithreaded applications.</b>
<p>Special compile-time flags are required when compiling threaded
applications on HP-UX.  If you are compiling a threaded application, you
must compile with the _REENTRANT flag:</p>
<blockquote><pre>cc -D_REENTRANT ...</pre></blockquote>
<p>The Berkeley DB library will automatically build with the correct options.</p>
<hr size=1 noshade>
<p><li><b>An ENOMEM error is returned from <a href="../../api_c/env_open.html">DB_ENV-&gt;open</a> or
<a href="../../api_c/env_remove.html">DB_ENV-&gt;remove</a>.</b>
<p>Due to the constraints of the PA-RISC memory architecture, HP-UX does not
allow a process to map a file into its address space multiple times.
For this reason, each Berkeley DB environment may be opened only once by a
process on HP-UX; that is, calls to <a href="../../api_c/env_open.html">DB_ENV-&gt;open</a> will fail if the
specified Berkeley DB environment has been opened and not subsequently closed.</p>
<hr size=1 noshade>
<p><li><b>When compiling with gcc, I see the following error:
<blockquote><pre>#error "Large Files (ILP32) not supported in strict ANSI mode."</pre></blockquote></b>
<p>We believe this is an error in the HP-UX include files, but we don't
really understand it.  The only workaround we have found is to add
-D__STDC_EXT__ to the C preprocessor defines as part of compilation.</p>
<hr size=1 noshade>
<p><li><b>When using the Tcl or Perl APIs (including running the test
suite), I see the error "Can't shl_load() a library containing Thread
Local Storage".</b>
<p>This problem happens when HP-UX has been configured to use pthread mutex
locking, and an attempt is made to call Berkeley DB using the Tcl or Perl APIs.
We have never found any way to fix this problem as part of the Berkeley DB
build process.  To work around the problem, rebuild tclsh or Perl, and
modify its build process to explicitly link it against the HP-UX pthread
library (currently /usr/lib/libpthread.a).</p>
<hr size=1 noshade>
<p><li><b>When running an executable that has been dynamically linked
against the Berkeley DB library, I see the error "Can't find path for shared
library" even though I correctly set the SHLIB_PATH environment variable.</b>
<p>By default, some versions of HP-UX ignore the dynamic library search
path specified by the SHLIB_PATH environment variable.  To work around
this, specify the "+s" flag to ld when linking, or run the following
command on the executable that is not working:</p>
<blockquote><pre>chatr +s enable -l /full/path/to/libdb-3.2.sl ...</pre></blockquote>
<hr size=1 noshade>
<p><li><b>I see errors about "open64" when building Berkeley DB applications.</b>
<p>System include files (most commonly fcntl.h) in some releases of AIX,
HP-UX and Solaris redefine "open" when large-file support is enabled for
applications.  This causes problems when compiling applications because
"open" is a method in the Berkeley DB APIs.  To work around this problem:
<ol>
<p><li>Avoid including the problematical system include files in source code
files which also include Berkeley DB include files and call into the Berkeley DB
API.
<li>Before building Berkeley DB, modify the generated include file db.h to itself
include the problematical system include files.
<li>Turn off Berkeley DB large-file support by specifying the
<a href="../../ref/build_unix/conf.html#--disable-largefile">--disable-largefile</a> configuration option and rebuilding.
</ol></p>
</ol>
<table width="100%"><tr><td><br></td><td align=right><a href="../build_unix/freebsd.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/irix.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
</body>
</html>