Solved

dbenv->open: Invalid argument , can not build Berkeley DB in RedHat Linux with --enable-posixmutexes

Posted on 2003-11-16
4
3,020 Views
Last Modified: 2010-04-29
Hi ,
I built Berkeley DB 4.0 in Red Hat Enterprise Linux WS release 2.1 (Tampa)
Kernel 2.4.9-e.12smp on an i686 .I installed gcc-3.2.3 , glibc-2.3.2 on this machine.
I use autoconfig as follow:
../dist/configure --prefix=/export/home/build/cal-5.1.0
                     --enable-shared
                     --disable-profiled
                     --cache-file=../../../config.cache
                     --enable-shared
                     --disable-static
                     --enable-cxx
                     --enable-posixmutexes

When I run my program , I got this messsge:
dbenv->open: Invalid argument

If i don't use autoconfig with --enable-posixmutexes option , my program can run ok , but there are 4 child process running with my program 's process .
I want to know if I can build Berkeley DB 4.0 in Red Hat Enterprise Linux WS release 2.1 with pthread library support or not .
Thank you very much.
.
0
Comment
Question by:honguyenbinh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
g0rath earned 50 total points
ID: 9771384
--enable-posixmutexes
To force Berkeley DB to use the POSIX pthread mutex interfaces for underlying mutex support, enter --enable-posixmutexes as an argument to configure. This is rarely necessary: POSIX mutexes will be selected automatically on systems where they are the preferred implementation.
The --enable-posixmutexes configuration argument is normally used in two ways: First, when there are multiple mutex implementations available and the POSIX mutex implementation is not the preferred one (for example, on Solaris where the LWP mutexes are used by default). Second, by default the Berkeley DB library will only select the POSIX mutex implementation if it supports mutexes shared between multiple processes, as described for the pthread_condattr_setpshared and pthread_mutexattr_setpshared interfaces. The --enable-posixmutexes configuration argument can be used to force the selection of POSIX mutexes in this case, which can improve application performance significantly when the alternative mutex implementation is a non-blocking one (for example test-and-set assembly instructions). However, configuring to use POSIX mutexes when the implementation does not have inter-process support will only allow the creation of private database environments, that is, environments where the DB_PRIVATE flag is specified to the DB_ENV->open method.

Specifying the --enable-posixmutexes configuration argument may require that Berkeley DB be linked with the -lpthread library.


========


Linux does not support the pthread_*attr_setpshared() function, and it appears that the rpms disable this option, and your are forcing this option....what happens that if you attempt to run this, it will return the error ENOSYS

Some rpms in their changelogs say they enable this and later disable this
0
 
LVL 5

Expert Comment

by:g0rath
ID: 9771444
If you want to see if there is a patch to allow this...you would have to see what the Redhat people do
You may want to download the latest source rpm from rpmfind, and then take a look at their patches.

http://www.rpmfind

rpm -ivh whatever.src.rpm

cd /usr/src/redhat

.../SOURCES - should have the patches
.../BUILD - will have the build directory
.../SPECS - will have the template that shows all the patches applied.
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question