[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]
Technical Reference: Base Operating System and Extensions, Volume 2
rs_setpartition Subroutine
Purpose
Sets the partition resource set of a process.
Library
Standard C library (libc.a)
Syntax
#include <sys/rset.h>
int rs_setpartition(pid, rset, flags)
pid_t pid;
rsethandle_t rset;
unsigned int flags;
Description
The rs_setpartition subroutine sets a process' partition
resource set. The subroutine can also be used to remove a process' partition
resource set.
The partition resource set limits the threads in a process to running only
on the processors contained in the partition resource set.
The work component is an existing process identified by the process ID.
A process ID value of RS_MYSELF indicates the attachment applies to the current
process.
The following conditions must be met to set a process' partition resource
set:
- The calling process must have root authority.
- The resource set must contain processors that are available in the system.
- The new partition resource set must be equal to, or a superset of the
target process' effective resource set.
- The target process must not contain any threads that have bindprocessor
bindings to a processor.
Parameters
pid |
Specifies the process ID of the process whose partition
resource set is to be set. A value of RS_MYSELF indicates the current process'
partition resource set should be set. |
rset |
Specifies the partition resource set to be set. A value
of RS_DEFAULT indicates the process' partition resource set should be removed. |
flags |
Reserved for future use. Specify as 0. |
Return Values
If successful, a value of 0 is returned. If unsuccessful, a value of -1
is returned, and the errno global variable is set to
indicate the error.
Error Codes
The rs_setpartition subroutine is unsuccessful if
one or more of the following are true:
EINVAL |
The flags parameter contains
an invalid value. |
ENODEV |
The resource set specified by the rset parameter does not contain any available processors. |
ESRCH |
The process identified by the pid parameter does not exist. |
EFAULT |
Invalid address. |
ENOMEM |
Memory not available. |
EPERM |
One of the following is true:
- The calling process does not have root authority.
- The process identified by the pid parameter has
one or more threads with a bindprocessor processor binding.
- The process identified by the pid parameter has
an effective resource set and the new partition resource set identified by
the rset parameter does not contain all of the effective
resource set's resources.
|
Related Information
rs_getpartition Subroutine and ra_attachrset Subroutine.
[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]