linear_rang...or_low_array(9)
π 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 arrayvalβ value for which the selector is searched πselectorβ address where found selector value is updatedfoundβ 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 β
0on success, periodt π-EINVALif 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:
linear_range_values_in_range(9)linear_range_values_in_range_array(9)linear_range_get_max_value(9)linear_range_get_value(9)linear_range_get_value_array(9)linear_range_get_selector_low(9)linear_range_get_selector_high(9)linear_range_get_selector_high_array(9)linear_range_get_selector_within(9)
β¨ 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms