device_change_owner(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… device_change_owner(9) β€” Kernel API Manual πŸŽ€

okay so bestie, this one lives in the Kernel API Manual, section 9, and honestly? it's giving "tiny function, big responsibilities." let's get into it ✨


✨ NAME ✨

device_change_owner β€” change the owner of an existing device. that's it, that's the whole vibe 🫢


🌸 SYNOPSIS 🌸

int device_change_owner (struct device *dev , kuid_t kuid , kgid_t kgid );

like, three args, one int back. short and iconic, no notes πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the device. the actual little guy we're doing all this for πŸ₯Ί
  • kuid β€” the new owner's kuid. yes, a kernel uid, not your regular-ass userspace one πŸ‘‘
  • kgid β€” the new owner's kgid. the group half of the glow-up πŸ’œ

πŸ”₯ DESCRIPTION πŸ”₯

so what this does is it changes the owner of dev and its corresponding sysfs entries over to kuid/kgid. both. together. matching. coordinated. we love a consistent look ✨

and the way it does it? it closely mirrors how dev was added via driver core. iykyk β€” it's doing the same moves, just for the ownership situation instead of the initial add πŸ’«

Returns 0 on success or an error code on failure. no cap, that's the whole return contract 😌


⭐ SEE ALSO ⭐

okay but the dedication?? seventy-six cross-references, the whole device_* friend group showed up to support 😭 love that for them πŸ’–

🌈 and that's the whole page 🌈

shoutout to ./drivers/base for being the section, October 2026 for the date, and the manpage device_change_owner(9) itself β€” she's small, she's specific, she changes sysfs ownership. periodt πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from