[bdbxml] Environment initialization on shmget systems.

Brian Myers <[email protected]>
Newsgroups gmane.comp.db.dbxml.general
Message-ID <[email protected]>
Hi,

A while back I asked about using the shmget interface with bsddb. 
I've finally come to believe that the set_shm_key code is working 
correctly. The problem I'm having is the same DBEnv.open() flags 
that work on Windows don't work on OS/X.

On Windows I'm initializing an environment by first creating an 
environment in a common directory and including the 
DB_RECOVER_FATAL | DB_CREATE flag. This removes an existing 
environment if it already exists. Then I initialize another 
environment in the same directory with the following flags:

DB_INIT_MPOOL | DB_SYSTEM_MEM | DB_CREATE | DB_THREAD

On Windows this works fine. However on OS/X, the code bombs 
either with a DBNoSuchFileError if the environment file 
(__db.001) doesn't exist. Of course it doesn't exist; bsddb is 
supposed to be creating it.

I need a method to properly initialize a shared memory 
environment that works on both shmget and non-shmget 
systems. I'm calling set_shm_key under Windows since it's just 
stubbed in that environment, and that seems to work fine. But 
bsddb doesn't want to create the shared environment file on OS/X, 
even though I have file create privilidges in the directory, and 
specified the DB_CREATE flag.

Any help appreciated,

Brian




------------------------------------------
To remove yourself from this list, send an
email to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.