linear_range...r_high_array(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay so bestie, welcome to linear_range...r_high_array(9) β€” that's the page name, the manual is the Kernel API Manual β€” and the actual main character of this whole thing is linear_range_get_selector_high_array, which does exactly one job: return linear range selector for value. that's it, that's the vibe. πŸ’…


🌸 SYNOPSIS 🌸

int linear_range_get_selector_high_array (const struct linear_range *r ,
int ranges , unsigned int val , unsigned int *selector , bool *found );

not me dropping the whole signature so you can see she's an int returning icon 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • r β€” pointer to the array of linear ranges where the selector is looked from. like, this is the lineup she's scanning through, no cap.
  • ranges β€” the amount of ranges to scan from the array. girl does not scan forever, she scans exactly this many. πŸ‘‘
  • val β€” the value for which the selector is searched. the whole reason we're here tbh.
  • selector β€” the address where the found selector value is updated. she doesn't just hand it to you, she writes it there. iykyk ✨
  • found β€” a flag to indicate that the given value was in the range. lowkey the receipts of whether the search actually landed. πŸ™ˆ

πŸ’– DESCRIPTION πŸ’–

okay so here's the lore: she scans the array of ranges for a selector whose range value matches the given input value. a value is matching if it is equal or higher than the given value. literally the whole rule, that's it.

if the given value is found to be in a range, scanning is stopped and found is set true. 🎯

and if a range with values greater than the given value is found, but the range min is greater than the given value, then the range's lowest selector is updated to selector and scanning is stopped. so she either finds it and slays, or she bails at the first thing that's too high and leaves you the lowest selector of that range. periodt. πŸ’€


πŸ”₯ RETURN πŸ”₯

  • 0 on success β€” she ate, no notes πŸ’…
  • -EINVAL if the range array is invalid, or it does not contain a range with a value greater or equal to the given value. so if the array is a mess or nothing is high enough, that's your error, bestie. 😭
fr fr do not sleep on that -EINVAL, it's covering two different situations and you're gonna want to actually read it. πŸ‘€

πŸ¦‹ SEE ALSO πŸ¦‹

the kernel file lives at ./lib/linear_ranges.c, and honestly the whole friend group is iconic:

go read those too, they're all serving in the same ./lib directory 🌈


and that's the page, bestie!! this one comes from ./lib, dated October 2026, and it's filed under linear_range...r_high_array(9) in the Kernel API Manual. mwah, go scan some ranges πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from