pset_ctl.2 (2010 09)
p
pset_ctl(2) pset_ctl(2)
[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 , or the request is
PSET_GETNEXTPROXIMATESPU
and there is no
other proximate processor after id in pset .
[EINVAL] The request is
PSET_GETNUMPROXIMATESPUS
or
PSET_GETFIRSTPROXIMATESPU
and the processor specified by id is not enabled.
[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;
/* Get total count of processor sets in the system */
pset_count = pset_ctl(PSET_GETNUMPSETS, 0, 0);
if (pset_count < 1) {
perror("pset_ctl(PSET_GETNUMPSETS)");
exit(1);
}
all_psets = (psetid_t *) malloc(sizeof(psetid_t)*pset_count);
memset(all_psets, 0, sizeof(psetid_t)*pset_count);
idx=0;
/* Get first processor set */
pset = pset_ctl(PSET_GETFIRSTPSET, 0, 0);
if (pset < 0) {
perror("pset_ctl(PSET_GETFIRSTPSET)");
exit(2);
}
all_psets[idx++] = pset;
/* Get remaining processor sets */
while (idx < pset_count) {
pset = pset_ctl(PSET_GETNEXTPSET, pset, 0);
if (pset < 0) {
perror("pset_ctl(PSET_GETNEXTPSET)");
exit(3);
} else {
all_psets[idx++] = pset;
}
}
AUTHOR
pset_ctl() was developed by HP.
SEE ALSO
psrset(1M), mpctl(2), pset_assign(2), pset_bind(2), pset_create(2), pset_destroy(2), pset_getattr(2),
pset_setattr(2), sysconf(2), privileges(5).
HP-UX 11i Version 3: September 2010 − 3 − Hewlett-Packard Company 3