The lgrp_nlgrps() function returns the number of locality groups in the system. If a system has only one locality group, memory placement optimizations have no effect.
#include <sys/lgrp_user.h> int lgrp_nlgrps(lgrp_cookie_t cookie);
The lgrp_nlgrps() function takes a cookie representing a snapshot of the lgroup hierarchy and returns the number of lgroups available in the hierarchy.
The lgrp_nlgrps() function returns EINVAL when the cookie is invalid.