The Miscellaneous Group contains the API for routines that don't clearly fit into any of the other module API groups.
More...
The Miscellaneous Group contains the API for routines that don't clearly fit into any of the other module API groups.
int mdbm_get_errno |
( |
MDBM * |
db | ) |
|
Returns the value of internally saved errno.
Contains the value of errno that is set during some lock failures. Under other circumstances, mdbm_get_errno will not return the actual value of the errno variable.
- Parameters
-
[in,out] | db | Database handle |
- Returns
- Saved errno value, or zero if OK
int mdbm_get_hash_value |
( |
datum |
key, |
|
|
int |
hashFunctionCode, |
|
|
uint32_t * |
hashValue |
|
) |
| |
Given a hash function code, get the hash value for the given key.
See mdbm_sethash for the list of valid hash function codes.
- Parameters
-
[in] | key | Key |
[in] | hashFunctionCode | for a valid hash function (below) |
[out] | hashValue | is calculated according to the hashFunctionCode |
- Returns
- Get Hash status
- Return values
-
-1 | Error, and errno is set |
0 | Success |
Values for hashFunctionCode:
- MDBM_HASH_CRC32 - Table based 32bit CRC
- MDBM_HASH_EJB - From hsearch
- MDBM_HASH_PHONG - Congruential hash
- MDBM_HASH_OZ - From sdbm
- MDBM_HASH_TOREK - From BerkeleyDB
- MDBM_HASH_FNV - Fowler/Vo/Noll hash (DEFAULT)
- MDBM_HASH_STL - STL string hash
- MDBM_HASH_MD5 - MD5
- MDBM_HASH_SHA_1 - SHA_1
- MDBM_HASH_JENKINS - Jenkins string
- MDBM_HASH_HSIEH - Hsieh SuperFast
Gets the MDBM page number for a given key.
The key does not actually have to exist.
- Parameters
-
[in,out] | db | Database handle |
[in] | key | Lookup key |
- Returns
- Page number or error indicator
- Return values
-
-1 | Error, and errno is set |
Page | number where the parameter key would be stored. |
int mdbm_preload |
( |
MDBM * |
db | ) |
|
Preload mdbm: Read every 4k bytes to force all pages into memory.
- Parameters
-
[in,out] | db | Database handle |
- Returns
- preload status
- Return values
-
int mdbm_lock_pages |
( |
MDBM * |
db | ) |
|
mdbm_lock_pages: Locks MDBM data pages into memory.
When running MDBM as root, mdbm_lock_pages will expand the amount of RAM that can be locked to infinity using setrlimit(RLIMIT_MEMLOCK). When not running as root, mdbm_lock_pages will expand the amount of RAM that can be locked up to the maximum allowed (retrieved using getrlimit(MEMLOCK), and normally a very small amount), and if the MDBM is larger than the amount of RAM that can be locked, a warning will be logged but mdbm_lock_pages will return 0 for success.
- Parameters
-
[in,out] | db | Database handle |
- Returns
- lock pages status
- Return values
-
int mdbm_unlock_pages |
( |
MDBM * |
db | ) |
|
mdbm_unlock_pages: Releases MDBM data pages from always staying in memory
- Parameters
-
[in,out] | db | Database handle |
- Returns
- unlock pages status
- Return values
-