memp_unlink

#include <db.h>

int
memp_unlink(const char *dir, int force, DB_ENV *);

Description

The memp_unlink function destroys the memory pool identified by the directorydir, removing all files used to implement the memory pool.
(The directory dir is not removed.)

If there are processes that have called memp_open without calling memp_close
(i.e., there are processes currently using the memory pool), memp_unlink will fail
without further action, unless the force flag is set, in which case memp_unlink
will attempt to remove the memory pool files regardless of any processes still using it.

The result of attempting to forcibly destroy the region when a process
has the region open is unspecified.
Processes using a shared memory region maintain an open file descriptor
for it.
On UNIX systems, the region removal should succeed
and processes that have already joined the region should continue to
run in the region without change,
however processes attempting to join the memory pool will either fail or attempt
to create a new region.
On other systems (e.g., Windows/NT), where the unlink(2) system
call will fail if any process has an open file descriptor for the file, the
region removal will fail.

In the case of catastrophic or system failure, database recovery must be
performed (see db_recover), or the DB_RECOVER and DB_RECOVER_FATAL
flags to db_appinit must be specified.
Alternatively, if recovery is not required because no database state is
maintained across failures, it is possible to clean up a memory pool by removing
all of the files in the directory specified to the memp_open function,
as no memory pool files are created in any other directory.
Note, however, that this has the potential to remove files created by
the other Berkeley DB subsystems in the same database environment.

The memp_unlink
function returns the value of errno on failure, and 0 on success.

Errors

If a fatal error occurs in Berkeley DB, the memp_unlink function may fail and return
DB_RUNRECOVERY, at which point all subsequent database calls will also
return DB_RUNRECOVERY.