HP-UX Reference (11i v3 07/02) - 2 System Calls (vol 5)

p
pset_ctl(2) pset_ctl(2)
PSET_SPUTOPSET
Return the ID of the processor set assigned for the processor specified in id. If the processor is
not enabled or is in transition from one processor set to another, -1 is returned with an error.
The pset argument is ignored.
Logical Processor and Processor Core Information
On systems with the Hyper-Threading (HT) feature enabled, each processor core may have more than one
hyper-thread per physical processor core. When hyper-threading is enabled at the firmware level, each
hyper-thread is represented to the operating system and applications as a logical processor (LCPU). Hence
the basic unit of any topology information is a logical processor. However, some applications may want to
get the system topology information at the physical processor core level.
PSET_GETNUMCORES
Returns the number of processor cores assigned to the processor set pset. Any processor cores in
the processor set that are in transition are not included. The id argument is ignored.
PSET_GETFIRSTCORE
Returns the ID of the first processor core in the processor set pset. It will return -1 if the proces-
sor set is empty. Any processor cores in the processor set that is in transition are ignored. The
id argument is ignored.
PSET_GETNEXTCORE
Returns the ID of the next processor core in the processor set pset after the processor specified in
id. Typically, PSET_GETFIRSTCORE
is called to determine the first processor core in a pro-
cessor set.
PSET_GETNEXTCORE
is then called in a loop (until the call returns -1) to determine
the IDs of remaining processor cores in the processor set.
PSET_LDOMCORES
Returns the number of enabled processor cores assigned to the processor set pset.
Any user may query the system processor set topology using the pset_ctl() function.
Use sysconf() with _SC_PSET_SUPPORT
name to see if the processor set functionality is supported
by the underlying HP-UX operating system version.
RETURN VALUE
pset_ctl() returns a value based on on successful completion.
>=0 Success. The value is based on the request.
-1 Failure. errno is set to indicate the error.
ERRORS
pset_ctl() sets errno to one of the following values if the corresponding condition is detected.
[EINVAL] The request is invalid.
[EINVAL] The specified processor set pset, or the processor or the locality domain specified by id
is invalid.
[EINVAL] The request is
PSET_GETNEXTPSET
and there is no other processor set after pset,
or the request is
PSET_GETNEXTSPU and there is no other processor after id in
pset, or the request is PSET_GETNEXTLDOM and there is no other locality domain
after id in pset.
[ENOSYS] The processor set functionality is not supported by the underlying HP-UX version.
EXAMPLES
Get total count and IDs of all processor sets in the system.
#include <sys/pset.h>
/*
* Get list of all processor sets in the system.
*/
psetid_t *all_psets;
int pset_count, idx;
psetid_t pset;
284 Hewlett-Packard Company 2 HP-UX 11i Version 3: February 2007