tld_get_data(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 valid tld_object that's already been initialized by tld_object_init. like, please initialize it first, don't do the messy thing πŸ™ˆ
  • key β€” the cached key of the TLD in tld_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: size has to be a known constant, and key has to be declared as a tld_key_t member of tld_keys by 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