1KSTRTOBOOL(9) Basic C Library Functions KSTRTOBOOL(9)
23
4
NAME
6kstrtobool - convert common user inputs into boolean values
7
SYNOPSIS
9int kstrtobool(const char * s, bool * res);
10
ARGUMENTS
12s
13input string
1415
res
16result
17
DESCRIPTION
19This routine returns 0 iff the first character is one of 'Yy1Nn0', or
20[oO][NnFf] for “on” and “off”. Otherwise it will return -EINVAL. Value
21pointed to by res is updated upon finding a match.
22
COPYRIGHT
24Kernel Hackers Manual 3.10 June 2019 KSTRTOBOOL(9)