Berkeley DB: lock_id
Полезная информация


#include <db.h>

int lock_id(DB_LOCKTAB *lt, u_int32_t *idp);


The lock_id function copies a locker ID, which is guaranteed to be unique in the specified lock table, into the memory location referenced by idp.

The Berkeley DB access methods generate a unique locker ID for each file that is opened with locking. During Berkeley DB access method operation, this locker ID will be used for all lock calls unless a transaction identifier was specified for the call, in which case the transaction ID specified is used as the locker ID.

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


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

The lock_id function may fail and return errno for any of the errors specified for the following Berkeley DB and C library functions: abort(3), fcntl(3), fprintf(3), and getpid(3).

See Also

lock_close, lock_detect, lock_get, lock_id, lock_open, lock_put, lock_stat, lock_unlink and lock_vec.