kobject_has_children(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… kobject_has_children β€” a Kernel API Manual moment (section 9, bestie)

okay so picture this: it's the Kernel API Manual, and we're doing kobject_has_children(9). yes that's the whole vibe. come on in πŸŽ€


✨ NAME ✨

kobject_has_children β€” literally just tells you whether a kobject has children or not. that's it. that's the whole function. she's simple, she's iconic, she slays πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

bool kobject_has_children (struct kobject *kobj );

🌸 ARGUMENTS 🌸

  • kobj β€” the object we're testing. the one we're asking about. the main character, if you will πŸ‘‘

⭐ DESCRIPTION ⭐

so basically this returns whether a kobject has other kobjects hanging around as children. like, does she have a little squad of sub-kobjects under her? yes or no, bool, done. 🫢

πŸ’€ important caveat, no cap: it does NOT account for the presence of attribute files β€” only sub directories. so don't come at her asking about attribute files, that's not her job, she will not answer.
πŸ™ˆ also, it assumes there is no concurrent addition or removal of such children. so it relies on external locking. read that again: external locking. she is not doing the locking for you, bestie β€” that's on you. don't set her up like that 😭

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/base/core.c β€” and like, a truly unserious number of friends. here they all are, every single one, no skips:

iykyk πŸ’œ


that's the whole page, bestie β€” short and sweet, one bool, one very important locking disclaimer. and before you go: this little gem lives in ./drivers/base, it's dated October 2026, and it's brought to you by the Kernel API Manual (section 9, obviously πŸ’…). mwah, go check your locking πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from