idr_get_next_ul(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

idr_get_next_ul β€” bestie, it finds the next populated entry. That's the whole vibe ✨


🌸 SYNOPSIS 🌸

void * idr_get_next_ul (struct idr *idr , unsigned long *nextid );

πŸŽ€ ARGUMENTS πŸŽ€

  • idr β€” your IDR handle 🫢 the little tree you're digging through.
  • nextid β€” a pointer to an ID. Yeah, a pointer β€” we're doing pointer things, keep up πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so listen. idr_get_next_ul returns the next populated entry in the tree whose ID is greater than or equal to the value that nextid is pointing at. Slay πŸ”₯

On exit, nextid gets updated to the ID of the value it found β€” literally it rewrites itself to tell you where it landed πŸ‘‘

And here's the part everyone forgets, no cap: to use it in a loop, the value pointed to by nextid must be incremented by the user. Like, by you. Manually. It does not do it for you 😭 so don't come crying to me when you get the same entry forever, iykyk.

fr fr: increment it yourself or you're stuck in an infinite loop and that's on you, not on the kernel πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./lib/idr.c β€” and the whole friend group:


mmm okay that's the whole page, you ate that πŸ“ stay hydrated, go increment your nextid, and remember: this one lives in ./lib, dated October 2026, and it's idr_get_next_ul(9) β€” main character energy only πŸ’œβœ¨

πŸ“¦ where this page comes from