struct_size(9)
struct_size(9) π β Kernel API Manual, bestie edition β¨
π NAME π
okay so struct_size β calculate the size of a structure with a trailing array. that's the whole assignment, bestie. periodt. π
β¨ SYNOPSIS β¨
struct_size (p , member , n );
π¦ ARGUMENTS π¦
pβ pointer to the structure. main-character pointer energy, honestly.memberβ name of the array member. yes, the actual member name, no cap.nβ number of elements in the array. count 'em. π₯
πΈ DESCRIPTION πΈ
It calculates the size of memory needed for structure p followed by an array of n member elements. that's it, that's the function. lowkey iconic for not making you do the math yourself. π§
π RETURN π
It returns the number of bytes needed, or SIZE_MAX on overflow. yep, overflow gets the dramatic SIZE_MAX treatment. π¨
π SEE ALSO π
- Kernel file
./tools/include/linux/overflow.h size_mul(9)array_size(9)array3_size(9)
go be nosy and read those too, iykyk. π«Ά
xoxo, struct_size(9) π β source/version ./tools/include/linux, Kernel API Manual, October 2026 π
π¦ 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