TDB_CHAINLOCK(3)

πŸ“¦
version 1.4.15+samba4.24.7 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– tdb_chainlock β€” the manual page, but make it make sense πŸ’–

okay bestie, welcome to tdb_chainlock(3), straight outta the Linux Programmer's Manual. this is the page about locking a whole lil group of keys at once, and honestly? it's giving power. πŸ‘‘


✨ NAME ✨

tdb_chainlock β€” lock a group of keys

tdb_chainunlock β€” unlock a previously locked group of keys


🌸 SYNOPSIS 🌸

#include <tdb.h>

int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key);
void tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key);

like yes, that's the whole vibe check. two functions, one job. 🫢


πŸ’… DESCRIPTION πŸ’…

okay so tdb_chainlock is a low-level function, and when i say low-level i mean it is not here to hold your hand. it locks a particular key β€” and, plot twist, a number of other keys too β€” without any checking. no vibes check, no safety net, just lock. πŸ”’

the consequence? any other process that tries to do tdb operations on those keys is gonna block until tdb_chainunlock gets called. so it's just sitting there, waiting, like a bestie outside the fitting room. πŸ§β€β™€οΈ


πŸ‘€ NOTES πŸ‘€

⚠️ bestie, listen to me. it is the user's responsibility to make sure you do not deadlock the database with these functions. that's on you, not on tdb. no cap. πŸ’€

and here's the wild part β€” that kind of deadlock is something which is impossible when you use the other access functions. so like… these two are the chaotic ones. the main character energy is real but so is the risk. 🌈


πŸŽ€ RETURN VALUE πŸŽ€

  • 0 β€” success, slay, we ate. ✨
  • -1 β€” failure. it's giving tragedy. 😭

πŸ¦‹ AUTHORS πŸ¦‹

  • Software: Andrew Tridgell <tridge@linuxcare.com>
  • Man page: Rusty.

⭐ SEE ALSO ⭐

go read those too, iykyk. πŸ‘‘


this page came to you courtesy of Samba, dated Oct 13, 2000 β€” yeah she's an icon from another era and she still serves. periodt. πŸ’œ