ra_detachrset Subroutine
Purpose
Detaches a work component from a resource set.
Library
Standard C library (libc.a)
Syntax
#include <sys/rset.h>
int ra_detachrset (rstype, rsid, flags)
rstype_t rstype;
rsid_t rsid;
unsigned int flags;
Description
The ra_detachrset subroutine detaches a work component specified by rstype and rsid from a resource set.
The work component is an existing process identified by the process ID or an existing kernel thread identified by the kernel thread ID (tid). A process ID or thread ID value of RS_MYSELF indicates the detach command applies to the current process or the current kernel thread, respectively.
- The calling process must either have root authority or have CAP_NUMA_ATTACH capability.
- The calling process must either have root authority or the same effective userid as the target process.
- For R_FILDES rstype, the calling process must specify an open file descriptor, and it must have write access to the file, or the calling process' effective userid must be equal to the file owner's userid.
- For R_SHM rstype, the calling process' effective userid must be equal to the shared segment's owner.
If these conditions are not met, the operation will fail.
Once a process is detached from a resource set, the threads in the process can run on all available processors contained in the process' partition resource set. Once a kernel thread is detached from a resource set, that thread can run on all available processors contained in its process effective or partition resource set.
Parameters
Item | Description |
---|---|
rstype | Specifies the type of work component to be detached
from to the resource set specified by rset. This parameter
must be the following value, defined in rset.h:
|
rsid | Identifies the work component to be attached
to the resource set specified by rset. This parameter must
be the following:
|
flags | For rstype of R_PROCESS,
the R_DETACH_ALLTHRDS indicates that R_THREAD rsets are
detached from all threads in a specified process. The process' effective rset is
not detached in this case. 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
Item | Description |
---|---|
EINVAL | One of the following is true:
|
ESRCH | The process or kernel thread identified by the rstype and rsid parameters does not exist. |
EPERM | One of the following is true:
|