- NetBSD Manual Pages
SETBIT(9) NetBSD Kernel Developer's Manual SETBIT(9)
Powered by man-cgi (2021-03-02).
Maintained for NetBSD
by Kimmo Suominen.
Based on man-cgi by Panagiotis Christias.
setbit -- macros related to bitmaps
The setbit family of macros operate with bitmaps, also known as bit
In a nutshell, setbit() sets the bit x in array, clrbit() clears it,
isset() tests whether x is set, and isclr() returns 1 if x is not set.
The following example declares a buffer of 10 chars, treating it as an
array of 80 bits:
setbit(buf, 12); /* set the fifth bit in the second byte */
The number of valid bits in a given array is assumed to be multiple of
CHAR_BIT, the number of bits for smallest object that is not a bit-field.
NetBSD 9.99 December 4, 2012 NetBSD 9.99