tdb_writelock(Aug 16, 2000) tdb_writelock(Aug 16, 2000) NAME tdb_writelock - lock the database for writing. tdb_write- unlock - unlock a previously locked database tdb_chainlock - lock a hash chain for writing tdb_chainunlock - unlock a previousl unlocked chain SYNOPSIS #include int tdb_writelock(TDB_CONTEXT *tdb); int tdb_writeunlock(TDB_CONTEXT *tdb); int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key); int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key); DESCRIPTION NOTE: To be really honest, I have no idea why these when functions are necessary. From what I can see tdb does all locking automatically now. My only guess is that these functions are either not supposed to be part of the exposed API or they are depricated. tdb_writelock locks the entire database and tdb_writeun- lock unlocks the database. This function does not appear to be necessary in the current version of TDB. In tdb keys are kept on hash chains. At any given time an unknown number of keys may be on any given hash chain. The intent of tdb_chainlock is to reduce contention for the global writelock by making the locks finer grained. tdb_chainlock locks the hash chain on which the index key exists. tdb_chainunlock unlocks a particular chain of records. This function does not appear to be necessary in the current version of TDB. The TDB_DATA structure pointed to by key is defined as: typedef struct { char *dptr; size_t dsize; } TDB_DATA; RETURN VALUE A return value of 0 indicates success and -1 indicates failure. AUTHORS Software: Andrew Tridgell and Luke Kenneth Casson Leighton Man page: Ben Woodard SEE ALSO gdbm(3), tdb(3) Linux Programmer's Manual Samba 1