kstrtoull(9)
π¦ kstrtoull(9) π¦
okay bestie, welcome to the kstrtoull(9) page from the Kernel API Manual π this one is all about turning a string into an unsigned long long, and yes, the details matter fr fr.
πΈ NAME πΈ
kstrtoull β convert a string to an unsigned long long β¨
π SYNOPSIS π
int kstrtoull (const char *s , unsigned int base , unsigned 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, but not 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. Preferred over simple_strtoull. Return code must be checked. no cap, do not skip that check π
bestie, this is the moment to be a responsible main character: check the return code. periodt π
π SEE ALSO π
Kernel file ./lib/kstrtox.c β peep these icons:
_parse_integer_limit(9)kstrtoll(9)kstrtouint(9)kstrtoint(9)kstrtobool(9)kstrtoudec64(9)kstrtodec64(9)
mwah π this lil page came from ./lib, dated October 2026, and itβs your girl kstrtoull(9) β slay and read the return code πβ¨
π¦ 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