Using lgrp_cpus()
The lgrp_cpus()
function takes a cookie that represents a
snapshot of the lgroup hierarchy and returns the number of CPUs in a given
lgroup.
#include <sys/lgrp_user.h>
int lgrp_cpus(lgrp_cookie_t cookie, lgrp_id_t lgrp, processorid_t *cpuids,
uint_t count, int content);If the cpuid[] argument is not NULL and
the CPU count is not zero, the lgrp_cpus()
function fills the
array with CPU IDs until the array is full or all the CPU IDs are in the
array.
The content argument can have the following two
values:
-
LGRP_CONTENT_ALL -
The
lgrp_cpus() function returns IDs for the CPUs in this lgroup and its child lgroups. -
LGRP_CONTENT_DIRECT -
The
lgrp_cpus() function returns IDs for the CPUs in this lgroup only.
The lgrp_cpus()
function returns EINVAL when the
cookie, lgroup ID, or one of the flag is not valid. The
lgrp_cpus()
function returns ESRCH
when the specified lgroup ID is not found. For more information, see the
lgrp_cpus(3LGRP) man page.