linear_rang...or_low_array(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

linear_range_get_selector_low_array β€” bestie, this one returns the linear range selector for a value ✨


🌸 SYNOPSIS 🌸

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

πŸŽ€ ARGUMENTS πŸŽ€

  • r β€” pointer to array of linear ranges where selector is looked from 🫢
  • ranges β€” amount of ranges to scan from array
  • val β€” value for which the selector is searched πŸ”
  • selector β€” address where found selector value is updated
  • found β€” flag to indicate that given value was in the range

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so picture this: you've got a whole array of ranges, right? This function scans that array of ranges for the selector whose range value matches the input value you handed it. A value counts as matching if it's equal or smaller than the given value β€” that's the vibe check it has to pass, no cap πŸ’…

If the given value is found to be in a range, scanning stops immediately β€” like, we found our girl, we're done β€” and found gets set to true. πŸŽ‰

But here's the plot twist 😭: if a range with values smaller than the given value turns up, yet that range's max is being smaller than the given value, then the range's biggest selector gets updated to selector, but scanning the ranges continues and found gets set to false. So it's like, "we got something, but not the thing" energy. Keep going, gorl.


⭐ RETURN ⭐

  • 0 on success, periodt πŸŽ€
  • -EINVAL if the range array is invalid, or if it does not contain a range with a value smaller or equal to the given value πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./lib/linear_ranges.c, plus the whole friend group:


✨ that's the whole page, bestie ✨ this one's from the Kernel API Manual, section 9, living its best life over in ./lib, dated October 2026 πŸ§šπŸ’œ go forth and select those ranges, iykyk 🫢

πŸ“¦ where this page comes from