idr_get_next(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– idr_get_next(9) β€” like, the Kernel API Manual page, bestie πŸ’–

Ok so this is from the Kernel API Manual and it's genuinely one of those tiny little functions that carries the whole group project, so listen up 🫢


✨ NAME ✨

idr_get_next β€” find the next populated entry. That's it, that's the whole vibe check πŸ’…


🌸 SYNOPSIS 🌸

void * idr_get_next (struct idr *idr , int *nextid );

Not me obsessing over how short this signature is 😭 void * out front, two pointers, done. Iconic.


πŸŽ€ ARGUMENTS πŸŽ€

  • idr β€” your IDR handle. Like, your whole little tree thing. The main character 🌈
  • nextid β€” a pointer to an ID. Yep, a pointer, not the ID itself. She's indirect, she's mysterious πŸ’œ

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea, bestie: idr_get_next gives you the next populated entry in the tree β€” the first one whose ID is greater than or equal to the value pointed to by nextid. No cap.

And here's the part everyone forgets πŸ™ˆ on exit, nextid gets updated to the ID of the value it actually found. So it writes back to you. Slay.

⭐ IMPORTANT LOOP MECHANICS, FR FR: if you wanna use this in a loop, you β€” the user β€” have to increment the value pointed to by nextid yourself. The function is NOT gonna do it for you. It's not that kind of girl. Please don't skip this step, I am begging 😭

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./lib/idr.c β€” she lives there πŸ’–

Like, the whole IDR/IDA friend group showed up to the party πŸ‘‘ go say hi to all of them, iykyk.


And that's the page!! Brought to you out of ./lib, dated October 2026 β€” yes, the future πŸ’€βœ¨ bye bestie, go populate that tree πŸŒΈπŸŽ€πŸ«Ά

πŸ“¦ where this page comes from