---
name: "bitmap_from_u32array"
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_from_u32array"
---

# bitmap\_from\_u32array(9)

copy the contents of a u32 array of bits to bitmap

## NAME

bitmap\_from\_u32array - copy the contents of a u32 array of bits to bitmap

## SYNOPSIS

**unsigned int bitmap\_from\_u32array(unsigned long \*** *bitmap***, unsigned int** *nbits***, const u32 \*** *buf***, unsigned int** *nwords***);**

## ARGUMENTS

*bitmap*

array of unsigned longs, the destination bitmap, non NULL

*nbits*

number of bits in *bitmap*

*buf*

array of u32 (in host byte order), the source bitmap, non NULL

*nwords*

number of u32 words in *buf*

## DESCRIPTION

copy min(nbits, 32\*nwords) bits from *buf* to *bitmap*, remaining bits between nword and nbits in *bitmap* (if any) are cleared. In last word of *bitmap*, the bits beyond nbits (if any) are kept unchanged.

Return the number of bits effectively copied.

## COPYRIGHT
