1KSTRTOUL(9)                Basic C Library Functions               KSTRTOUL(9)
2
3
4

NAME

6       kstrtoul - convert a string to an unsigned long
7

SYNOPSIS

9       int kstrtoul(const char * s, unsigned int base, unsigned long * res);
10

ARGUMENTS

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, but not 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

DESCRIPTION

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                       KSTRTOUL(9)
Impressum