tld_get_data(9)
π tld_get_data(9) β like, the kernel API manual bestie π
okay so we're in the Kernel API Manual and today's main character is tld_get_data, a little function that's gonna hand you a pointer to the TLD hanging out with your name. yes bestie, that's the whole vibe. let's get into it β¨
πΈ NAME πΈ
tld_get_data β Retrieve a pointer to the TLD associated with the name. that's it, that's the mission π
β¨ SYNOPSIS β¨
tld_get_data (tld_obj , key , name , size );
literally the whole signature, no notes π
π¦ ARGUMENTS π¦
tld_objβ a pointer to a validtld_objectthat's already been initialized bytld_object_init. like, please initialize it first, don't do the messy thing πkeyβ the cached key of the TLD intld_key_map. it's the key, in the map, cached. iykyk πnameβ the name of the key associated with a TLD. yes, name and key are different things here, keep up bestie πsizeβ the size of the TLD. it must be a known constant value, no cap. not a vibe if you improvise here π«
π DESCRIPTION π
so what does it do? it returns a pointer to the TLD associated with name. easy. π«Ά
and if it's not found?? or if size is too big?? you get NULL. that's the whole deal β nothing found or too big = NULL, so check your pointer, bestie π
here's the cute part: key is used to cache the key if the TLD is found, which speeds up subsequent calls. obsessed with efficiency fr fr π₯
and the developer (that's you, mwah π) should define that key as a member of tld_keys of tld_key_t type. periodt. π
π§ SEE ALSO π§
- Kernel file
./tools/testing/selftests/bpf/progs/task_local_data.bpf.h tld_object_init(9)β go read this one first, it's giving prerequisites β¨
friendly reminder:sizehas to be a known constant, andkeyhas to be declared as atld_key_tmember oftld_keysby you, the developer. no skipping steps, bestie π
and that's the page!! π from the Kernel API Manual, source ./tools/testing/selftests/bpf/..., dated October 2026 β tld_get_data(9) signing off, slay responsibly πβ¨πΈπ¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms