]> git.sur5r.net Git - openldap/commitdiff
Merge remote-tracking branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_4
authorQuanah Gibson-Mount <quanah@openldap.org>
Mon, 21 Oct 2013 18:03:27 +0000 (11:03 -0700)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 21 Oct 2013 18:03:27 +0000 (11:03 -0700)
libraries/liblmdb/lmdb.h
libraries/liblmdb/mdb.c

index f72869e6c85b75d35c38a6d6ae6859e27d69abda..f6d0a0af1f421e2ef4c9dbe6ec521edd7153a996 100644 (file)
@@ -679,6 +679,18 @@ int  mdb_env_get_flags(MDB_env *env, unsigned int *flags);
         */
 int  mdb_env_get_path(MDB_env *env, const char **path);
 
+       /** @brief Return the filedescriptor for the given environment.
+        *
+        * @param[in] env An environment handle returned by #mdb_env_create()
+        * @param[out] fd Address of a mdb_filehandle_t to contain the descriptor.
+        * @return A non-zero error value on failure and 0 on success. Some possible
+        * errors are:
+        * <ul>
+        *      <li>EINVAL - an invalid parameter was specified.
+        * </ul>
+        */
+int  mdb_env_get_fd(MDB_env *env, mdb_filehandle_t *fd);
+
        /** @brief Set the size of the memory map to use for this environment.
         *
         * The size should be a multiple of the OS page size. The default is
index e52da918a43c563c1395d6fdef7ae7f4efde2ea4..33be87672d53c1d0dee23fd49a1bf4a9d30fb150 100644 (file)
@@ -7817,6 +7817,16 @@ mdb_env_get_path(MDB_env *env, const char **arg)
        return MDB_SUCCESS;
 }
 
+int
+mdb_env_get_fd(MDB_env *env, mdb_filehandle_t *arg)
+{
+       if (!env || !arg)
+               return EINVAL;
+
+       *arg = env->me_fd;
+       return MDB_SUCCESS;
+}
+
 /** Common code for #mdb_stat() and #mdb_env_stat().
  * @param[in] env the environment to operate in.
  * @param[in] db the #MDB_db record containing the stats to return.