bitmap_parselist(9)

bitmap_parselist9

Convert list format ascii string to bitmap

Usage

int bitmap_parselist(const char * bp, unsigned long * maskp, int nmaskbits);

Arguments

bp

read nul-terminated user string from this buffer

maskp

write resulting mask here

nmaskbits

number of bits in mask to be written

Overview

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.

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

Releases

3 releases since Debian 4.0 (Etch); the text changed 2 times.

  1. 4.0
  2. 5.0
  3. 6.0

From linux-manual-2.6.32 2.6.32-48squeeze6 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.