ethnl_name_to_idx(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ethnl_name_to_idx (it's giving "kernel API manual" energy)

okay so bestie, welcome to the ethnl_name_to_idx glow-up, straight out of the Kernel API Manual. this is the little function that goes "hey, what index does this name live at?" and honestly? iconic behavior. it's a lookup girlie. that's the whole vibe. πŸŽ€


✨ NAME ✨

ethnl_name_to_idx β€” look up the string index for a name πŸ”

like, you hand it a name, it hands you back where that name sits in the array. matchmaking, basically. πŸ’–


🌸 SYNOPSIS 🌸

int ethnl_name_to_idx (ethnl_string_array_t names , unsigned int n_names
, const char *name );

no cap, that's the whole signature β€” names, n_names, name, three besties in a trench coat. 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • names β€” the array of ETH_GSTRING_LEN sized strings. yep, each one is exactly ETH_GSTRING_LEN sized, that's the rule, we respect it. πŸ’…
  • n_names β€” the number of strings chilling in the array. so it knows where the party ends. ⭐
  • name β€” the name you're looking up. the main character of this whole operation, fr fr. πŸ‘‘

πŸ”₯ RETURN πŸ”₯

if it finds it: the index of the string. slay. βœ…

if it doesn't: -ENOENT, which is kernel-speak for "not found, bestie, she's not here" πŸ˜­πŸ’€


🌈 SEE ALSO 🌈

the kernel file ./net/ethtool/bitset.c, plus the whole friend group:

go read them, they're all lowkey obsessed with bitsets and honestly so am I πŸ§šπŸ’œ


and that's the page!! mwah πŸ’‹ this one came from ./net/ethtool, dated October 2026 β€” periodt, no notes. πŸ“

πŸ“¦ where this page comes from