Berkeley DB Reference Version 5.3.33

DB_ENV->set_flags()

#include <db.h>

int
DB_ENV->set_flags(DB_ENV *dbenv, u_int32_t flags, int onoff);  

Configure a database environment.

The database environment's flag values may also be configured using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_flags", one or more whitespace characters, and the method flag parameter as a string, and optionally one or more whitespace characters, and the string "on" or "off". If the optional string is omitted, the default is "on"; for example, "set_flags DB_TXN_NOSYNC" or "set_flags DB_TXN_NOSYNC on". Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

The DB_ENV->set_flags() method returns a non-zero error value on failure and 0 on success.

Parameters

flags

The flags parameter must be set by bitwise inclusively OR'ing together one or more of the following values:

onoff

If the onoff parameter is zero, the specified flags are cleared; otherwise they are set.

Errors

The DB_ENV->set_flags() method may fail and return one of the following non-zero errors:

EINVAL

An invalid flag value or parameter was specified.

Class

DB_ENV

See Also

Database Environments and Related Methods