linear_rang...selector_low(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… linear_range_get_selector_low(9)

okay so bestie, welcome to the Kernel API Manual ✨ we're doing kernel math today and honestly? it's giving glow-up. this one lives in the linear ranges universe and it's lowkey iconic πŸŽ€


✨ NAME ✨

linear_range_get_selector_low β€” return linear range selector for value πŸ¦‹

like, you hand it a value, it hands you back a selector. match made in heaven fr fr πŸ’–


🌸 SYNOPSIS 🌸

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

no cap, that's the whole vibe πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • r β€” pointer to linear range where selector is looked from. this is the range we're snooping through πŸ”
  • val β€” value for which the selector is searched. the main character of this whole operation ⭐
  • selector β€” address where found selector value is updated. we write the answer here, so she better be ready πŸ’…
  • found β€” flag to indicate that given value was in the range. basically a little bool that goes "yup, we ate" πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

Return selector for which range value is closest match for given input value. 🫢

Value is matching if it is equal or smaller than given value. so like, the range value has to be <= your input β€” not bigger, bestie, that's the whole rule 🌈

If given value is in the range, then found is set true. πŸŽ‰ so you always know whether the match was real or we were just reaching 😭


πŸ”₯ RETURN πŸ”₯

  • 0 on success πŸ‘‘
  • -EINVAL if range is invalid or does not contain value smaller or equal to given value πŸ™ˆ
⚠️ heads up: -EINVAL isn't just "oops bad range" β€” it also fires when there's literally no value in the range that's smaller than or equal to what you asked for. check that found flag, iykyk πŸ’–

⭐ SEE ALSO ⭐

Kernel file ./lib/linear_ranges.c plus the whole friend group πŸ’œ:


and that's the page!! 🌸 brought to you straight outta ./lib 🧚, dated October 2026 β€” screenshot it, annotate it, put it on your fridge, periodt πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from