match_int(9)
π match_int(9) β the kernel manpage, bestie edition β¨
okay so you found yourself staring at match_int, the little parsing gremlin from the kernel's parser.c squad π she's not flashy, but she works, and honestly? iconic.
πΈ NAME πΈ
match_int β scan a decimal representation of an integer out of a substring_t π§
β¨ SYNOPSIS β¨
int match_int (substring_t *s , int *result );
that's the whole signature, no cap π«Ά
π¦ ARGUMENTS π¦
sβ thesubstring_tyou want scanned, like, the actual text chunk under the microscope πresultβ where the resulting integer lands if everything goes off without a hitch π
π DESCRIPTION π
Attempts to parse the substring_t s as a decimal integer. that's it, that's the job β she reads the substring, she decides if it's giving "decimal integer" or not. highkey straightforward, lowkey essential π
π₯ RETURN π₯
On success, sets result to the integer represented by the string and returns 0 β
On failure? returns -EINVAL or -ERANGE π so yeah, check that return value, bestie, don't just assume it ate π
π SEE ALSO π
Kernel file ./lib/parser.c plus the whole friend group:
match_one(9)match_token(9)match_number(9)match_u64int(9)match_uint(9)match_u64(9)match_octal(9)match_hex(9)match_wildcard(9)match_strlcpy(9)match_strdup(9)
mwah π this one lives in ./lib, dated October 2026 β go read the whole parser.c squad, they ate and left no crumbs πβ¨
π¦ 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