1KSTRTOLL(9) Basic C Library Functions KSTRTOLL(9)
2
3
4
6 kstrtoll - convert a string to a long long
7
9 int kstrtoll(const char * s, unsigned int base, long long * res);
10
12 s
13 The start of the string. The string must be null-terminated, and
14 may also include a single newline before its terminating null. The
15 first character may also be a plus sign or a minus sign.
16
17 base
18 The number base to use. The maximum supported base is 16. If base
19 is given as 0, then the base of the string is automatically
20 detected with the conventional semantics - If it begins with 0x the
21 number will be parsed as a hexadecimal (case insensitive), if it
22 otherwise begins with 0, it will be parsed as an octal number.
23 Otherwise it will be parsed as a decimal.
24
25 res
26 Where to write the result of the conversion on success.
27
29 Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
30 Used as a replacement for the obsolete simple_strtoull. Return code
31 must be checked.
32
34Kernel Hackers Manual 3.10 June 2019 KSTRTOLL(9)