} else if ( strcasecmp( argv[0], "dirtyread" ) == 0 ) {
bdb->bi_db_opflags |= DB_DIRTY_READ;
#endif
- /* transaction checkpoint configuration */
+ /* transaction logging configuration */
} else if ( strcasecmp( argv[0], "dbnosync" ) == 0 ) {
bdb->bi_dbenv_xflags |= DB_TXN_NOSYNC;
if( rc != LDAP_SUCCESS ) return 1;
+ /* unique key for shared memory regions */
+ } else if ( strcasecmp( argv[0], "shm_key" ) == 0 ) {
+ if ( argc < 2 ) {
+ fprintf( stderr,
+ "%s: line %d: missing key in \"shm_key <key>\" line\n",
+ fname, lineno );
+ return( 1 );
+ }
+ bdb->bi_shm_key = atoi( argv[1] );
+
/* size of the cache in entries */
} else if ( strcasecmp( argv[0], "cachesize" ) == 0 ) {
if ( argc < 2 ) {
if( !(slapMode & SLAP_TOOL_MODE) ) flags |= DB_RECOVER;
#endif
+ /* If a key was set, use shared memory for the BDB environment */
+ if ( bdb->bi_shm_key ) {
+ bdb->bi_dbenv->set_shm_key( bdb->bi_dbenv, bdb->bi_shm_key );
+ flags |= DB_SYSTEM_MEM;
+ }
+
bdb->bi_dbenv->set_errpfx( bdb->bi_dbenv, be->be_suffix[0].bv_val );
bdb->bi_dbenv->set_errcall( bdb->bi_dbenv, bdb_errcall );
bdb->bi_dbenv->set_lk_detect( bdb->bi_dbenv, bdb->bi_lock_detect );