sysfs_update_group(9)
π 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:
sysfs_create_group(9)sysfs_create_groups(9)sysfs_update_groups(9)sysfs_remove_group(9)sysfs_remove_groups(9)sysfs_merge_group(9)sysfs_unmerge_group(9)sysfs_add_link_to_group(9)sysfs_remove_link_from_group(9)compat_only_sysfs_link_entry_to_kobj(9)sysfs_group_change_owner(9)sysfs_groups_change_owner(9)
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
- 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