STDC_TRAILING_ZEROS(9F) Kernel Functions for Drivers
stdc_trailing_zeros, stdc_trailing_zeros_uc, stdc_trailing_zeros_us,
stdc_trailing_zeros_ui, stdc_trailing_zeros_ul, stdc_trailing_zeros_ull
- count consecutive trailing zero bits
#include <sys/stdbit.h>
unsigned int
stdc_trailing_zeros(generic_value_type value);
unsigned int
stdc_trailing_zeros_uc(unsigned char value);
unsigned int
stdc_trailing_zeros_us(unsigned short value);
unsigned int
stdc_trailing_zeros_ui(unsigned int value);
unsigned int
stdc_trailing_zeros_ul(unsigned long value);
unsigned int
stdc_trailing_zeros_ull(unsigned long long value);
The stdc_trailing_zeros() family of functions counts the number of
consecutive zero bits present in value starting at the least
significant bit.
The stdc_trailing_zeros() function is generic and will operate on all
8, 16, 32, and 64-bit unsigned integers; however, it is only available
in C23. The other functions all operate on a specific integer type,
but otherwise behave the same and are available regardless of the C
language version.
These functions may be called from user, kernel, or interrupt context.
The functions in the stdc_trailing_zeros() family always return the
number of trailing zeros found in value. These functions cannot fail.
Committed
stdc_trailing_zeros(3C), stdc_bit_ceil(9F), stdc_bit_floor(9F),
stdc_bit_width(9F), stdc_count_ones(9F), stdc_count_zeros(9F),
stdc_first_leading_one(9F), stdc_first_leading_zero(9F),
stdc_first_trailing_one(9F), stdc_first_trailing_zero(9F),
stdc_has_single_bit(9F), stdc_leading_ones(9F), stdc_leading_zeros(9F),
stdc_trailing_ones(9F)
illumos October 27, 2024 illumos
NAME
stdc_trailing_zeros, stdc_trailing_zeros_uc, stdc_trailing_zeros_us,
stdc_trailing_zeros_ui, stdc_trailing_zeros_ul, stdc_trailing_zeros_ull
- count consecutive trailing zero bits
SYNOPSIS
#include <sys/stdbit.h>
unsigned int
stdc_trailing_zeros(generic_value_type value);
unsigned int
stdc_trailing_zeros_uc(unsigned char value);
unsigned int
stdc_trailing_zeros_us(unsigned short value);
unsigned int
stdc_trailing_zeros_ui(unsigned int value);
unsigned int
stdc_trailing_zeros_ul(unsigned long value);
unsigned int
stdc_trailing_zeros_ull(unsigned long long value);
DESCRIPTION
The stdc_trailing_zeros() family of functions counts the number of
consecutive zero bits present in value starting at the least
significant bit.
The stdc_trailing_zeros() function is generic and will operate on all
8, 16, 32, and 64-bit unsigned integers; however, it is only available
in C23. The other functions all operate on a specific integer type,
but otherwise behave the same and are available regardless of the C
language version.
CONTEXT
These functions may be called from user, kernel, or interrupt context.
RETURN VALUES
The functions in the stdc_trailing_zeros() family always return the
number of trailing zeros found in value. These functions cannot fail.
INTERFACE STABILITY
Committed
SEE ALSO
stdc_trailing_zeros(3C), stdc_bit_ceil(9F), stdc_bit_floor(9F),
stdc_bit_width(9F), stdc_count_ones(9F), stdc_count_zeros(9F),
stdc_first_leading_one(9F), stdc_first_leading_zero(9F),
stdc_first_trailing_one(9F), stdc_first_trailing_zero(9F),
stdc_has_single_bit(9F), stdc_leading_ones(9F), stdc_leading_zeros(9F),
stdc_trailing_ones(9F)
illumos October 27, 2024 illumos