diff --git a/libraries/liblmdb/lmdb.h b/libraries/liblmdb/lmdb.h index 9019b31..8bd341c 100644 --- a/libraries/liblmdb/lmdb.h +++ b/libraries/liblmdb/lmdb.h @@ -720,6 +720,13 @@ int mdb_env_get_maxreaders(MDB_env *env, unsigned int *readers); */ int mdb_env_set_maxdbs(MDB_env *env, MDB_dbi dbs); + /** @brief Get the maximum size of a key for the environment. + * + * @param[in] env An environment handle returned by #mdb_env_create() + * @return The maximum size of a key. (#MDB_MAXKEYSIZE) + */ +int mdb_env_get_maxkeysize(MDB_env *env); + /** @brief Create a transaction for use with the environment. * * The transaction handle may be discarded using #mdb_txn_abort() or #mdb_txn_commit(). diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 0c53766..ca72334 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -8069,6 +8069,11 @@ int mdb_set_relctx(MDB_txn *txn, MDB_dbi dbi, void *ctx) return MDB_SUCCESS; } +int mdb_env_get_maxkeysize(MDB_env *env) +{ + return MDB_MAXKEYSIZE; +} + int mdb_reader_list(MDB_env *env, MDB_msg_func *func, void *ctx) { unsigned int i, rdrs;