tb_property_format_dir(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… tb_property_format_dir(9) β€” or, how to pack a directory for the Thunderbolt fabric

okay bestie, so this is a page from the Kernel API Manual, and it's all about tb_property_format_dir ✨ it lives over in ./drivers/thunderbolt and it's giving "glow-up your property directory into wire format" energy πŸ¦‹


🌸 NAME 🌸

tb_property_format_dir β€” formats a directory to the packed XDomain format πŸŽ€


✨ SYNOPSIS ✨

ssize_t tb_property_format_dir (const struct tb_property_dir *dir , u32
*block , size_t block_len );

like, that's the whole signature, no cap πŸ’…


🫢 ARGUMENTS 🫢

  • dir β€” the directory you wanna format, bestie. that's the one.
  • block β€” the property block where the packed data gets placed. it's the destination, the moment, the main character πŸ‘‘
  • block_len β€” length of the property block. gotta know how much room you're working with, fr fr.

πŸ’– DESCRIPTION πŸ’–

so this function formats the directory into the packed format that can then be sent over the thunderbolt fabric to the receiving host πŸ”₯ like it's literally turning your nice structured directory into something you can yeet across the wire. iconic behavior.

and here's the little twist: passing NULL in block returns the number of entries the block takes πŸ‘€ so you can ask "how big is this gonna be" before you commit. very considerate of it, honestly.


🌈 RETURN 🌈

  • 0 on success πŸ’š
  • a negative errno otherwise 😭 (so like, check it. please. i'm begging.)

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/thunderbolt/property.c β€” go read it, iykyk πŸ“–

and the whole friend group:


πŸ’€ real talk: the function returns a negative errno on failure, so please actually look at the return value before you go sending stuff over the fabric. past you will thank present you. 🫢

and that's the page, bestie! 🌟 this one's from ./drivers/thunderbolt, dated October 2026, and it's part of the Kernel API Manual β€” slay, periodt, go pack some directories πŸ’œπŸŽ€

πŸ“¦ where this page comes from