__BITMAP_PARSELIST(9) | Basic Kernel Library Functions | __BITMAP_PARSELIST(9) |
NAME¶
__bitmap_parselist - convert list format ASCII string to bitmap
SYNOPSIS¶
int __bitmap_parselist(const char * buf, unsigned int buflen, int is_user, unsigned long * maskp, int nmaskbits);
ARGUMENTS¶
buf
buflen
is_user
maskp
nmaskbits
DESCRIPTION¶
Input format is a comma-separated list of decimal numbers and ranges. Consecutively set bits are shown as two hyphen-separated decimal numbers, the smallest and largest bit numbers set in the range. Optionally each range can be postfixed to denote that only parts of it should be set. The range will divided to groups of specific size. From each group will be used only defined amount of bits. Syntax: range:used_size/group_size
EXAMPLE¶
0-1023:2/256 ==> 0,1,256,257,512,513,768,769
Returns 0 on success, -errno on invalid input strings.
Error values:
-EINVAL: second number in range smaller than first
-EINVAL: invalid character in string
-ERANGE: bit number specified too large for mask
COPYRIGHT¶
March 2017 | Kernel Hackers Manual 4.10 |