sysfs_update_group(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… sysfs_update_group β€” the Kernel API Manual glow-up, bestie ✨

okay so picture this: it's giving kernel API manual realness, and today's main character is sysfs_update_group(9). no cap, she's here to refresh your attribute group without any drama. πŸŽ€


✨ NAME ✨

sysfs_update_group β€” given a directory kobject, update an attribute group πŸ¦‹

literally what it says on the tin. kobject goes in, group gets updated. slay.


🌸 SYNOPSIS 🌸

int sysfs_update_group (struct kobject *kobj , const struct attribute_group *grp );

yes bestie, int return. she gives you a number back. keep reading for what that number means πŸ‘‘


πŸ’– ARGUMENTS πŸ’–

  • kobj β€” the kobject you're updating the group on. like, the directory energy. this is where the group lives 🏠
  • grp β€” the attribute group you're updating. the actual group getting the glow-up 🌈

🧚 DESCRIPTION 🧚

okay so this function updates an attribute group. simple as that. but here's the tea β˜•:

unlike sysfs_create_group, she will explicitly not warn or error if any of the attribute files being created already exist. like, she's not gonna yell at you for double-booking. she just handles it. icon behaviour fr fr πŸ’…

furthermore: if the visibility of the files has changed through the is_visible callback, she'll update the permissions and add or remove the relevant files. so like, if your files suddenly have a different vibe check, she adjusts. adding, removing, permission-shifting β€” she does it all ✨

🚨 warning bestie, listen up: changing a group's name (that's the subdirectory name under kobj's directory in sysfs) is not allowed. like, absolutely not. do not come for her subdirectory name. it's fixed. periodt. πŸ’€

the primary use for this function is to call it after making a change that affects group visibility. that's the whole point. that's her moment. that's her main character energy πŸ”₯

returns 0 on success or error code on failure. so if you get 0, you ate. anything else, something went sideways 😭


⭐ SEE ALSO ⭐

your girl has friends, and they're all iconic in their own right. go say hi πŸ‘‹

Kernel file ./fs/sysfs/group.c, plus:

iykyk 🫢


aaaand that's the page!! sourced straight from ./fs/sysfs, dated October 2026, sysfs_update_group(9) forever and always πŸ’œβœ¨ bye bestie, go update those groups responsibly πŸ§šβ€β™€οΈπŸ’–

πŸ“¦ where this page comes from