Solved

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

Posted on 2003-11-16
4
2,950 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
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
g0rath earned 50 total points
Comment Utility
--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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now