_parse_integer_limit(9)
okay bestie, say hi to _parse_integer_limit(9) from the Kernel API Manual โจ this one is a lowkey workhorse, but weโre gonna get through it together, fr fr ๐
๐ NAME ๐
_parse_integer_limit โ convert integer string representation to an integer ๐งฎโจ
๐ธ SYNOPSIS ๐ธ
unsigned int _parse_integer_limit (const char *s , unsigned int base ,
unsigned long long *p , size_t max_chars , unsigned long long init );
๐ฆ ARGUMENTS ๐ฆ
sโ Integer string representation. the string bestie, the main character of this conversion ๐baseโ Radix. yes, the radix ๐งฎโจpโ Where to store result. this is where the result goes ๐max_charsโ Maximum amount of characters to convert. literally the max amount of characters to convert ๐ฅinitโ Initial value of the multiply-accumulate result. the starting value for the multiply-accumulate situation ๐ซถ
๐ DESCRIPTION ๐
okay so what it does: it converts a non-negative integer string representation in an explicitly given radix to an integer. If overflow occurs, the value at p is set to ULLONG_MAX ๐จ๐ญ
also important: this function is the workhorse of other string conversion functions, and it is discouraged to use it explicitly. Consider the kstrto*() family instead. iykyk ๐
โจ
๐ RETURN ๐
Number of characters consumed, maybe ORed with overflow bit ๐๐ซ
โญ SEE ALSO โญ
Kernel file ./lib/kstrtox.c and the gang: kstrtoull(9), kstrtoll(9), kstrtouint(9), kstrtoint(9), kstrtobool(9), kstrtoudec64(9), kstrtodec64(9) ๐ซถ go read those if youโre being a good bestie ๐ฆ
mwah ๐ โ source/version: ./lib, date: October 2026, signing off from the Kernel API Manual girlies ๐๐ธ
๐ฆ 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