struct_group_attr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct_group_attr πŸ’–

okay so bestie, welcome to the Kernel API Manual page for struct_group_attr β€” yes, this is a real man page from the kernel docs, and yes, it's lowkey iconic πŸŽ€


✨ NAME ✨

struct_group_attr β€” the one that creates a struct_group() with trailing attributes πŸ¦‹


✨ SYNOPSIS ✨

struct_group_attr (NAME , ATTRS , MEMBERS... );

like that's the whole vibe. no cap, that's the signature, don't touch it πŸ’…


✨ ARGUMENTS ✨

  • NAME β€” the identifier name of the mirrored sub-struct. basically the name tag for the named twin 🏷️
  • ATTRS β€” any struct attributes you wanna apply. this is the part that earns the _attr in the name, periodt ✨
  • MEMBERS β€” the member declarations for the mirrored structs. the actual contents, the main character energy of the whole thing πŸ‘‘

✨ DESCRIPTION ✨

so here's the tea β˜• β€” this is used to create an anonymous union of two structs with identical layout and size: one anonymous and one named.

the former (the anonymous one) can be used normally without sub-struct naming β€” just vibes, no prefix needed. and the latter (the named one) can be used to reason about the start, end, and size of the group of struct members 🫢

and the whole point of this specific one: it includes structure attributes argument β€” that's the ATTRS bit, that's the flex πŸ’…βœ¨

ngl this is the struct_group()-but-with-attributes variant, so if you don't need attributes, go hang with the plain one instead 🧚

✨ SEE ALSO ✨

like, the whole friend group fr fr 🌸


and that's the page!! much love from ./include/linux, dated October 2026, brought to you by the kernel docs gang β€” slay, study up, and go read stddef.h bestie πŸ’œπŸŽ€πŸ¦‹

πŸ“¦ where this page comes from