kstrtoll(9)
πΈ NAME πΈ
okay so bestie, this is kstrtoll(9) from the Kernel API Manual β and itβs literally here to convert a string to a long long β¨
β¨ SYNOPSIS β¨
int kstrtoll (const char *s , unsigned int base , long long *res );
π ARGUMENTS π
sβ the start of the string, bestie. The string must be null-terminated, and it may also include a single newline before its terminating null. The first character may also be a plus sign or a minus sign πbaseβ the number base to use. The maximum supported base is16. Ifbaseis given as0, then the base of the string is automatically detected with the conventional semantics β if it begins with0xthe number will be parsed as a hexadecimal (case insensitive), if it otherwise begins with0, it will be parsed as an octal number. Otherwise it will be parsed as a decimal π§resβ where to write the result of the conversion on success π«Ά
π DESCRIPTION π
Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error. Itβs preferred over simple_strtoll. The return code must be checked π
not me emphasizing this again: check the return code, fr fr π
π¦ SEE ALSO π¦
Kernel file ./lib/kstrtox.c:
_parse_integer_limit(9)kstrtoull(9)kstrtouint(9)kstrtoint(9)kstrtobool(9)kstrtoudec64(9)kstrtodec64(9)
sourced from ./lib, dated October 2026, and this iconic lil page is kstrtoll(9) β slay and bye bestie πππ¦
π¦ 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