)I$Berkeley DB: lock_put[P

lock_put





#include <db.h>

int'lock_put(DB_LOCKTAB *lt, DB_LOCK lock);





Description



hThe lock_put function is a simple interface to the lock_vecfunctionality.

tIt is equivalent to calling the lock_vec function with a single elementGlist array, for which the op field is DB_LOCK_PUT and the=lock field is represented by the lock argument.

@The lock_put method returns success and failure as described forCthe lock_vec function.

FIf a process dies while holding locks, those locks remain held and areBnever released. In this case, all processes should exit as:quickly as possible, so that database recovery can be run.



Errors

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

The lock_put)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), shmat(3), shmdt(3), strerror(3), vfprintf(3), vsnprintf(3),and write(3).

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

L

EACCES
An attempt was made to release lock held by another locker.


B

EINVAL
An invalid flag value or parameter was specified.







See Also

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