tpm_buf_length(9)
π tpm_buf_length β like, the kernel API manual bestie π
okay so you're looking at the tpm_buf_length(9) page, obviously, and it's a tiny little function but it's lowkey iconic. it lives in the kernel API manual, and it does exactly one thing: it tells you the number of bytes consumed by the data. that's it. that's the whole vibe. periodt. β¨
πΈ NAME πΈ
tpm_buf_length β returns the number of bytes consumed by the data π
π¦ SYNOPSIS π¦
u16 tpm_buf_length (struct tpm_buf *buf );
no cap, that's the whole signature. it takes one pointer and hands you back a u16. simple. elegant. main character energy. π
π ARGUMENTS π
bufβ atpm_buf. yep. that's the entire description. she's atpm_buf. that's the whole argument. ngl it's giving "the docs said what they said" but honestly? respect. π«Ά
π RETURN π
the number of bytes consumed by the buffer. that is literally it. the return value is the byte count, and the byte count is the return value, and honestly the way that works out is kind of beautiful. ππ
bestie the return type is u16 so likeβ¦ it's a 16-bit number. the manpage doesn't editorialize about overflow and neither will i, but just. keep it in mind. iykyk. π
β SEE ALSO β
okay this is where the friend group shows up, because tpm_buf_length does NOT roll alone:
- the kernel file
./drivers/char/tpm/tpm-buf.c(yes, that's where all this lives π) tpm_buf_init(9)tpm_buf_init_sized(9)tpm_buf_reset(9)tpm_buf_reset_sized(9)tpm_buf_append(9)tpm_buf_append_handle(9)tpm_buf_read(9)tpm_buf_read_u8(9)tpm_buf_read_u16(9)tpm_buf_read_u32(9)
the whole tpm_buf squad, assembled. ate. π₯
okay that's the page!! no notes, she's short and she knows it π
mwah π β this was brought to you by ./drivers/char/tpm, dated October 2026, and the kernel API manual. go read tpm-buf.c if you want the full lore π§ββοΈ
π¦ 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