mdb_env_copyfd2 function

int mdb_env_copyfd2(
  1. Pointer<MDB_env> env,
  2. int fd,
  3. int flags
)

@brief Copy an LMDB environment to the specified file descriptor, with options.

This function may be used to make a backup of an existing environment. No lockfile is created, since it gets recreated at need. See #mdb_env_copy2() for further details. @note This call can trigger significant file size growth if run in parallel with write transactions, because it employs a read-only transaction. See long-lived transactions under @ref caveats_sec. @paramin env An environment handle returned by #mdb_env_create(). It must have already been opened successfully. @paramin fd The filedescriptor to write the copy to. It must have already been opened for Write access. @paramin flags Special options for this operation. See #mdb_env_copy2() for options. @return A non-zero error value on failure and 0 on success.

Implementation

@ffi.FfiNative<
    ffi.Int Function(ffi.Pointer<MDB_env>, mdb_filehandle_t,
        ffi.UnsignedInt)>('mdb_env_copyfd2')
external int mdb_env_copyfd2(
  ffi.Pointer<MDB_env> env,
  int fd,
  int flags,
);