tb_property_format_dir(9)
π 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 π
0on success π- a negative
errnootherwise π (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:
tb_property_parse_dir(9)tb_property_create_dir(9)tb_property_free_dir(9)tb_property_copy_dir(9)tb_property_merge_dir(9)tb_property_add_immediate(9)tb_property_add_data(9)tb_property_add_text(9)tb_property_add_dir(9)tb_property_remove(9)tb_property_find(9)tb_property_get_next(9)
π 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
- 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