#include <sys/cguser.h>int cg_memloc(caddr_t addr, size_t len, cgid_t *vec);
cg_memloc returns the primary memory residency status of pages in the address space covered by mappings in the range [addr, addr + len]. The status is returned as a list of CPU-Group identifiers in the array referenced by *vec (which the system assumes to be large enough to encompass all the pages in the address range).
The addr parameter should be a page-aligned address. If the
byte count len
is not an integral number of pages, it will be treated as if it were
rounded up to the next page size multiple. The page size can be
obtained from sysconf(_SC_PAGESIZE
).
If a page is present on a single CPU-Group, the (non-negative) identifier of that CPU-Group is returned in the corresponding location in the array referenced by *vec.
If a page is not present on any CPU-Group, the negative value CG_NONE is returned in the corresponding location in the array referenced by *vec.
If neither case applies (for example, if a page is replicated across multiple CPU-Groups) an unspecified negative value is returned in the corresponding location in the array referenced by *vec.