match_uint(9)
π 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β thesubstring_tto 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
resultto the integer represented by the string, and returns0. slay. ate. left no crumbs. π - On failure β you get
-EINVALor-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.0means we're so back, negative means we're so not. check it before you trustresult, 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:
match_one(9)match_token(9)match_number(9)match_u64int(9)match_int(9)match_u64(9)match_octal(9)match_hex(9)match_wildcard(9)match_strlcpy(9)match_strdup(9)
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
- 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