kstrtoll(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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 is 16. If base is given as 0, then the base of the string is automatically detected with the conventional semantics β€” if it begins with 0x the number will be parsed as a hexadecimal (case insensitive), if it otherwise begins with 0, 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:


sourced from ./lib, dated October 2026, and this iconic lil page is kstrtoll(9) β€” slay and bye bestie πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from