rb_add(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– rb_add(9) πŸ’–

okay so bestie, welcome to rb_add(9) from the Kernel API Manual β€” this is the red-black tree girlie's insert function and she is literally here to drop one node into one tree. no cap. 🌸


✨ NAME ✨

rb_add β€” insert @node into @tree πŸŽ€

like that's it, that's the whole job, and she does it flawlessly πŸ’…


🌈 SYNOPSIS 🌈

void rb_add (struct rb_node *node , struct rb_root *tree , bool
       (*less)(struct rb_node *, const struct rb_node *) );

look at her. iconic signature. three little arguments and a whole lot of tree energy πŸ¦‹


πŸ’œ ARGUMENTS πŸ’œ

  • node β€” the node you wanna insert. your main character. she's going in the tree, periodt. ✨
  • tree β€” the tree you're inserting node into. the venue. the group chat. the whole vibe. 🌳
  • less β€” the operator that defines the (partial) node order. so like, this is the function pointer that tells everything how to sort itself out, and yes bestie it's a partial order, that's what the man page says, don't come for me πŸ™ˆ
ngl less being a function pointer with struct rb_node * and const struct rb_node * as its params is giving "i know exactly what i'm doing" energy and honestly? she does πŸ‘‘

🫢 SEE ALSO 🫢

okay so if you're obsessed with this one (and you should be), the whole friend group is right here:

every single one of them, no skips, we don't leave the squad behind πŸ’€πŸ’–


and that's the page!! mwah πŸ’‹ this little masterpiece lives in ./tools/include/linux and the date on it is October 2026 β€” so yeah, she's from the future, she's from the kernel, she's rb_add(9) and she ate. πŸŒŸπŸ‘‘πŸŽ€

πŸ“¦ where this page comes from