TDB_EXISTS(3)
π TDB_EXISTS β bestie's guide to the tdb_exists(3) manual page π
okay so. you're here, you're in the Linux Programmer's Manual, and you wanna know if a record is literally in your tdb database or not. this page has u covered, no cap. β¨
πΈ NAME πΈ
tdb_exists β check for the existence of a record in a tdb database π¦
β¨ SYNOPSIS β¨
#include <tdb.h>
int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key);
π DESCRIPTION π
so the whole vibe here is: you're testing to see if a key exists. that's it, that's the job. π
tdbβ this is a pointer that got handed to you bytdb_open. like, it's the returned one, don't just make one up bestie πkeyβ this is a lump of data, and it's used as the index into the database. the way it just *indexes*β¦ iconic.
and the TDB_DATA structure is defined as:
typedef struct {
char *dptr;
size_t dsize;
} TDB_DATA;
that's it. that's the struct. dptr and dsize. periodt. π
π₯ RETURN VALUE π₯
the vibes are very binary here:
- if the key is found β
1is returned π«Ά - otherwise β
0is returned
no in-between, no maybe, no "it's complicated". just 1 or 0. slay.
π AUTHORS π
the legends behind this whole thing:
- Software: Andrew Tridgell
<tridge@linuxcare.com>and Luke Kenneth Casson Leighton π - Man page: Ben Woodard
<ben@valinux.com>π§
π SEE ALSO π
go check out these besties too, iykyk:
lowkey a lil reminder: tdb_exists is a test, not a read. it's giving "are u there" energy, not "tell me everything about urself". just sayin π
and that's the page, bestie!! this one's from the Samba crew, dated Aug 17, 2000 β a whole classic, a vintage icon, and honestly it still ate π β¨ mwah, go check ur keys π¦
π¦ where this page comes from
- debian trixie: libtdb-dev 2:1.4.13+samba4.22.10+dfsg-0+deb13u2 Β· GPL-3.0-or-later
- debian trixie: libtdb-dev 2:1.4.13+samba4.22.11+dfsg-0+deb13u1 Β· GPL-3.0-or-later
- ubuntu questing: libtdb-dev 2:1.4.13+samba4.22.3+dfsg-4ubuntu2
- ubuntu questing: libtdb-dev 2:1.4.13+samba4.22.3+dfsg-4ubuntu2.4
- ubuntu resolute: libtdb-dev 2:1.4.14+samba4.23.6+dfsg-1ubuntu2 Β· GPL-3.0-or-later
- ubuntu resolute: libtdb-dev 2:1.4.14+samba4.23.6+dfsg-1ubuntu2.2 Β· GPL-3.0-or-later
- ubuntu stonking: libtdb-dev 2:1.4.15+samba4.24.7+dfsg-1ubuntu1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms