pset_assign.2 (2010 09)

p
pset_assign(2) pset_assign(2)
When a processor core is assigned to another pset, depending on the source and target processor sets
PSET_ATTR_LCPU
(see pset_setattr (2)) value, the number of logical processors from that processor core
may change.
EXAMPLES
Reassign spu from its current processor set to new_pset , and retrieve the current processor set in
old_pset .
#include <sys/pset.h>
spu_t spu;
psetid_t new_pset, old_pset;
int ret;
/*
* Initialize spu and new_pset first.
* spu identifies the processor to be reassigned, whereas
* new_pset identifies the target processor set.
*/
if ((ret = pset_assign(new_pset, spu, &old_pset)) < 0) {
perror("pset_assign");
exit(1);
}
RETURN VALUE
pset_assign returns zero on successful completion. Otherwise, -1 is returned and errno is set to
indicate the error.
ERRORS
pset_assign fails if one or more of the following is true:
[EBUSY] The processor set currently assigned to the processor spu has active threads and processes,
and the processor set attributes do not allow this operation.
[EFAULT] The memory location pointed to by opset is not writable by the user.
[EINTR] The operation was interrupted.
[EINVAL] The processor spu or processor set pset is not valid.
[EINVAL] The spu is not enabled.
[EINVAL] The memory location pointed to by opset is
NULL, and the PS_QUERY operation is
requested.
[ENOSYS] The processor set functionality is not supported by the underlying HP-UX version.
[EPERM] The user does not have necessary permissions to assign spu to pset .
SEE ALSO
mpctl(2), pset_bind(2), pset_create(2), pset_ctl(2), pset_destroy(2), pset_getattr(2), pset_setattr(2),
privgrp(4), privileges(5).
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010