HP-UX Reference (11i v1 05/09) - 2 System Calls (vol 5)
p
pset_bind(2) pset_bind(2)
The child process and its first thread created by a
fork() or vfork() function will inherit the processor
set binding from the parent process. The new threads in the multi-threaded process will inherit their pro-
cessor set binding from the creator thread.
EXAMPLE
Migrate the current thread to another processor set new_pset, and retrieve its current processor set in
old_pset.
#include <sys/pset.h>
int ret;
psetid_t new_pset, old_pset;
/*
* Initialize new_pset first.
* Rebind the current thread to new_pset.
*/
ret = pset_bind( new_pset, P_LWPID, P_MYID, &old_pset);
if (ret < 0) {
perror("pset_bind");
exit(1);
}
RETURN VALUE
pset_bind() returns zero on successful completion. Otherwise, -1 is returned and errno is set to indi-
cate the error.
ERRORS
pset_bind fails if one or more of the following is true:
[EFAULT] The memory location pointed to by opset is not writable by the user.
[EINVAL] pset is not valid.
[EINVAL] idtype or id is not valid.
[EINVAL] pset is empty and the current setting of processor set attributes does not allow this operation
on an empty processor set.
[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] User does not have necessary permissions to bind a thread or a process to specified processor
set.
[EPERM] The specified thread or process is a system daemon.
[ESRCH] The specified thread, process, user id, or process group does not exist.
SEE ALSO
psrset(1M), fork(2), getprivgrp(2), pset_assign(2), pset_create(2), pset_ctl(2), pset_destroy(2),
pset_getattr(2), pset_setattr(2), vfork(2)
HP-UX 11i Version 1: September 2005 − 2 − Hewlett-Packard Company Section 2−−227