DB_ENV->set_recovery_init |
#include <db.h>int DB_ENV->set_recovery_init(DB_ENV *, int (*db_recovery_init_fcn)(DB_ENV *));
Applications installing application-specific recovery functions need to be called before Berkeley DB performs recovery so they may add their recovery functions to Berkeley DB's.
The DB_ENV->set_recovery_init function supports this functionality. The db_recovery_init_fcn function must be declared with one argument, a reference to the enclosing Berkeley DB environment. This function will be called after the DB_ENV->open has been called, but before recovery is started.
If the db_recovery_init_fcn function returns a non-zero value, no recovery will be performed, and DB_ENV->open will return the same value to its caller.
The DB_ENV->set_recovery_init interface may be used only to configure Berkeley DB before the DB_ENV->open interface is called.
The DB_ENV->set_recovery_init function returns a non-zero error value on failure and 0 on success.
The DB_ENV->set_recovery_init function may fail and return a non-zero error for the following conditions:
Called after DB_ENV->open was called.
The DB_ENV->set_recovery_init function may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions. If a catastrophic error has occurred, the DB_ENV->set_recovery_init function may fail and return DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way.