sysfs_create_groups(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay bestie, welcome to the sysfs_create_groups(9) page from the Kernel API Manual ✨

sysfs_create_groups β€” given a directory kobject, create a bunch of attribute groups. periodt πŸ’…

✨ SYNOPSIS ✨

the signature is giving:

int sysfs_create_groups (struct kobject *kobj , const struct
       attribute_group *const *groups );

πŸŽ€ ARGUMENTS πŸŽ€

  • kobj β€” the kobject to create the group on. literally where the group gets made, iykyk.
  • groups β€” the attribute groups to create, NULL terminated. keep that terminator in mind, bestie 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: this function creates a bunch of attribute groups 🌸

if an error occurs when creating a group, all previously created groups will be removed, unwinding everything back to the original state when this function was called. not me doing a full rollback 😭 it will explicitly warn and error if any of the attribute files being created already exist. so yeah, that's a whole vibe check.

the return is 0 on success, or the error code from sysfs_create_group on failure. slay when it works, dramatic unwind when it doesn't πŸ’€

🌈 SEE ALSO 🌈

kernel file: ./fs/sysfs/group.c β€” and the whole squad is here:

okay bye bestie πŸ’– source/version: ./fs/sysfs πŸŽ€ date: October 2026 ✨

πŸ“¦ where this page comes from