HP-UX Reference (11i v2 07/12) - 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 inherits the processor set
binding from the parent process. The new threads in the multi-threaded process inherits their processor
set binding from the creator thread.
Security Restrictions
Some or all of the actions associated with this system call require the
PSET privilege. Processes owned by
the superuser have this privilege. Processes owned by other users may have this privilege, depending on
system configuration. See privileges(5) for more information about privileged access on systems that sup-
port fine-grained privileges.
EXAMPLES
Migrate the current thread to another processor set new_pset, and retrive 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), pset_assign(2), pset_create(2), pset_ctl(2), pset_destroy(2), pset_getattr(2),
pset_setattr(2), vfork(2), privgrp(4), privileges(5).
HP-UX 11i Version 2: December 2007 Update − 2 − Hewlett-Packard Company 263