DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

cg_processors(S)


cg_processors -- return the processors within a CPU-Group

Synopsis

#include <sys/cguser.h>
#include <sys/processor.h>

int cg_processors( cgid_t cgid, int selector, int nprocessorids, processorid_t *processorid_array);

Description

cg_processors obtains a list of the processors within a CPU-Group and stores the result in the array of processor IDs specified by processorid_array. This array has nprocessorids entries and must be large enough to contain the entire list.

The cgid parameter specifies the CPU-Group for which the contained processor identifiers are to be returned. The special value CG_CURRENT may be used as shorthand for the caller's current CPU-Group.

The selector parameter takes the value P_ONLINE.

If the CPU-Group is not online, cg_processors fails with EAGAIN.

Return values

On success, cg_processors returns the number of selected processors within the CPU-Group. On failure, cg_processors returns a value of -1 and sets errno to indicate the error:

[EAGAIN]
The CPU-Group was not online

[EINVAL]
selector contains an invalid value

[EINVAL]
cgid contains an invalid value

[ENOSPC]
The value of nprocessorids is less than the number of specified processors in the CPU-Group.

[EFAULT]
A referenced part of the array pointed to by processorid_array is outside of the allocated address space of the process.

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

References

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