match_uint(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ match_uint β€” the kernel manual, but make it make sense πŸŽ€

okay so bestie, welcome to match_uint(9)</s> β€” wait, that's the section-9 kernel API page for match_uint, and honestly? she's a little icon. tiny function, huge main character energy. this is literally the girl who scans a decimal representation of an integer out of a substring_t. that's the whole job. that's her arc. πŸ’…


✨ NAME ✨

match_uint β€” scan a decimal representation of an integer from a substring_t. no cap, that's it, that's the vibe.


🌸 SYNOPSIS 🌸

int match_uint (substring_t *s , unsigned int *result );

like... look at her. two args, one int coming back at you. iconic signature, zero notes. 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • s β€” the substring_t to be scanned. this is the string-ish thing you're handing over, she's gonna look at it, she's gonna judge it (lovingly), she's gonna try to read a number out of it. πŸ’–
  • result β€” the resulting integer on success. this is where the good news lands. she writes the number here, so make sure you actually gave her somewhere to put it, bestie. πŸ™ˆ

🌈 DESCRIPTION 🌈

okay so the whole plot: match_uint attempts to parse the substring_t s as a decimal integer. that's the bit. that's the scene. she takes s, she goes "hmm, is there a decimal integer in here", and she goes for it. ✨

like, no hex shenanigans, no octal detours β€” decimal is the assignment and she is locked in on it. πŸ”₯


⭐ RETURN ⭐

the way this works is honestly so clean, listen:

  • On success β€” she sets result to the integer represented by the string, and returns 0. slay. ate. left no crumbs. πŸ‘‘
  • On failure β€” you get -EINVAL or -ERANGE. so like, either the input wasn't giving decimal integer at all (-EINVAL), or the number was doing the absolute most and blew out of range (-ERANGE). both are valid reasons to be dramatic about it. 😭
heads up bestie: the return value is literally the vibe check. 0 means we're so back, negative means we're so not. check it before you trust result, okay? πŸ’€

πŸ’œ SEE ALSO πŸ’œ

she has a whole friend group and they all live in the kernel file ./lib/parser.c. group chat lineup, in order:

iykyk β€” if you're parsing tokens out of a kernel string, you already know at least three of these girls. 🧚


and that's the page, bestie! this little cutie lives under ./lib, and this edition is dated October 2026 β€” so like, keep the match_uint(9) energy alive, mwah! πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from