3I(Berkeley DB: db_value_set[P

db_value_set





#include <db.h>

int#db_value_set(int value, int which);





Description



=The db_value_set function enables applications to specify the9behavior of underlying Berkeley DB library functionality.DThe which argument specifies the information being set by theargument value.

3The following values of which are supported:

\

DB_MUTEXLOCKS
Setting value to a zero value causes Berkeley DB to grant allJrequested mutual exclusion mutexes without testing for their availability.DThis flag should never be used for any other purpose than debugging.^

DB_REGION_ANON
Setting value to a non-zero value specifies that shared memoryJregions are to be created in anonymous memory, and not backed by a regularfile.JDB_REGION_NAME differs from DB_REGION_ANON in that the former will fail ifIthe shared memory regions cannot be named, that is, if multiple processescannot use them.OSee DB_FUNC_MAP for more information.e

DB_REGION_INIT
In some applications, the expense of page-faulting the shared memory regionsNcan affect performance, e.g., when the page-fault occurs while holding a lock,Cother lock requests can convoy and overall throughput may decrease.KSetting value to a non-zero value specifies that one byte be writtenKto each 4K page of the shared memory region when the region is initialized.

FIn addition, as a byte is written to each page, the underlying virtualDmemory and file systems are forced to instantiate both the necessaryFmemory and the necessary disk space. This is useful in order to avoid$out-of-disk space failures later on.^

DB_REGION_NAME
Setting value to a non-zero value specifies that shared memoryJregions are to be created in anonymous memory, and not backed by a regularfile.JDB_REGION_NAME differs from DB_REGION_ANON in that the former will fail ifIthe shared memory regions cannot be named, that is, if multiple processescannot use them.OSee DB_FUNC_MAP for more information.X

DB_TSL_SPINS
Specify the number of times mutexes should spin without blocking.

KThis value defaults to 1 on uniprocessor systems and to 50 times the number)of processors on multiprocessor systems.]



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



Errors

UIf a fatal error occurs in Berkeley DB, the db_value_set function may fail and returnFDB_RUNRECOVERY, at which point all subsequent database calls will alsoreturn DB_RUNRECOVERY.



B

EINVAL
An invalid flag value or parameter was specified.







See Also

?
db_jump_set
ÿÿ