DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

cg_memloc(S)


cg_memloc -- determine physical location of memory pages

Synopsis

#include <sys/cguser.h>

int cg_memloc(caddr_t addr, size_t len, cgid_t *vec);

Description

cg_memloc returns details of the current physical memory used to instantiate a portion of the calling process's address space.

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.

Return values

On success, cg_memloc returns 0. On failure, cg_memloc returns -1 and sets errno to indicate the error:

[EFAULT]
*vec includes an out-of-range or otherwise inaccessible address.

[EINVAL]
addr is not a multiple of the page size as returned by sysconf(S).

[ENOMEM]
The argument len has a value less than or equal to 0.

[ENOSYS]
The cg_memloc call is not supported by the system.

References

cg_current(S), sysconf(S)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005