bitmap_parse(9)
β¨ bitmap_parse(9) β Kernel API Manual β¨
okay bestie, gather round π this is bitmap_parse(9) and it's literally the glow-up that turns an ASCII hex string into a bitmap. no cap.
π NAME π
bitmap_parse β convert an ASCII hex string into a bitmap.
π οΈ SYNOPSIS π οΈ
int bitmap_parse (const char *start , unsigned int buflen , unsigned
long *maskp , int nmaskbits );
π§ ARGUMENTS π§
startβ pointer to buffer containing string. πΈbuflenβ buffer size in bytes. If string is smaller than this then it must be terminated witha or 0In that case,UINT_MAXmay be provided instead of string length. π«Άmaskpβ pointer to bitmap array that will contain result. πnmaskbitsβ size of bitmap, in bits. π₯
π DESCRIPTION π
Commas group hex digits into chunks. Each chunk defines exactly 32 bits of the resultant bitmask. No chunk may specify a value larger than 32 bits (-EOVERFLOW), and if a chunk specifies a smaller value then leading 0-bits are prepended. -EINVAL is returned for illegal characters. Grouping such as "1,,5", ",44", "," or "" is allowed. Leading, embedded and trailing whitespace accepted.
slay, but also: those error codes are doing important main-character work, so don't ignore them π
π SEE ALSO π
- Kernel file
./lib/bitmap-str.c bitmap_parse_user(9)bitmap_print_to_buf(9)bitmap_print_bitmask_to_buf(9)bitmap_print_list_to_buf(9)bitmap_parselist(9)bitmap_parselist_user(9)
π that's the whole vibe: hex string in, bitmap out, commas doing their little grouping thing, and error codes catching the chaos. periodt. π
π xoxo, your kernel bestie β source/version./lib, datedOctober 2026π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms