kobject_get_ownership(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… kobject_get_ownership (Kernel API Manual, section 9)

okay bestie, gather round, because today we're learning how to snag the sysfs ownership info for a kobject and honestly? it's giving "small function, big container energy" 🫢


✨ NAME ✨

kobject_get_ownership β€” gets the sysfs ownership data for @kobj. literally that's the whole job, no cap πŸ’–


🌸 SYNOPSIS 🌸

void kobject_get_ownership (const struct kobject *kobj , kuid_t *uid ,
       kgid_t *gid );

notice the void bestie β€” she returns nothing, she just fills things in. main character behavior, honestly πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • kobj β€” the kobject in question. yes, the kobject. the one we're talking about. keep up πŸ’…
  • uid β€” the kernel user ID for sysfs objects. this is where the user ID goes 🧚
  • gid β€” the kernel group ID for sysfs objects. and this is where the group ID goes πŸ“

πŸ¦‹ DESCRIPTION πŸ¦‹

So what does she actually do? She returns the initial uid/gid pair β€” the one you should be using when you create the sysfs representation of a given kobject ✨

And when is that a whole thing? Normally it's used to adjust the ownership of objects inside a container 🫢 like, the vibes of "this object lives in a container and needs its own ownership situation" β€” that's the use case, fr fr.

no extra lore, no secret behavior, that's genuinely it. she's simple, she's iconic, she ate πŸ’–


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./lib/kobject.c β€” and the whole kobject/kset friend group, because they all roll together 🌈

iykyk πŸ’œ


okay that's the page!! this one came from ./lib, dated October 2026, and it's filed under kobject_get_ownership(9) β€” mwah, go read the source bestie, it's right there πŸ’‹βœ¨

πŸ“¦ where this page comes from