#include <db.h>int db_appexit(DB_ENV *dbenv);
The db_appexit function closes the initialized Berkeley DB subsystems, freeing any allocated resources and closing any underlying subsystems.
In multi-threaded applications, only a single thread may call db_appexit.
The db_appexit function returns the value of errno on failure, and 0 on success.
The db_appexit function may fail and return errno for any of the errors specified for the following Berkeley DB and C library functions: free(3), lock_close, log_close, memp_close, memset(3), strlen(3), and txn_close.