match_int(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the substring_t you 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:


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