)I$Berkeley DB: lock_get[P

lock_get





#include <db.h>

int*lock_get(DB_LOCKTAB *lt, u_int32_t locker,$ u_int32_t flags, const DBT *obj,2 const db_lockmode_t lock_mode, DB_LOCK *lock);





Description



hThe lock_get function is a simple interface to the lock_vecfunctionality.

gIt is equivalent to calling the lock_vec function with the lt, >locker and flags arguments, and a single element@list array, for which the op field is DB_LOCK_GET,?and the obj, lock_mode and lock fields are.represented by the arguments of the same name.

<Note that the type of the obj argument to lock_get isHdifferent from the obj element found in the DB_LOCKREQ structure.

BThe lock_get function returns success and failure as described forCthe lock_vec function.

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



Errors

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

The lock_get)function may fail and return errnoKfor any of the errors specified for the following Berkeley DB and C library functions: abort(3), fcntl(3), fflush(3), fprintf(3), fsync(3), getpid(3),<lock_detect, lseek(3), memcpy(3), memset(3),mmap(3), munmap(3),pstat_getdynamic(3), shmat(3), shmdt(3), strerror(3), sysconf(3), vfprintf(3), vsnprintf(3),and write(3).

In addition, the lock_get)function may fail and return errnofor the following conditions:

B

EINVAL
An invalid flag value or parameter was specified.







See Also

:lock_close,<lock_detect, lock_get,4lock_id,8lock_open,3lock_put,8lock_stat,;lock_unlinkand6lock_vec.
ÿÿ