---
name: "__bitmap_parselist"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/__bitmap_parselist"
---

# \_\_bitmap\_parselist(9)

convert list format ASCII string to bitmap

## 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*

read nul-terminated user string from this buffer

*buflen*

buffer size in bytes. If string is smaller than this then it must be terminated with a \\0.

*is\_user*

location of buffer, 0 indicates kernel space

*maskp*

write resulting mask here

*nmaskbits*

number of bits in mask to be written

## 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
