ra_getrset Subroutine

Purpose

Gets the resource set to which a work component is attached.

Library

Standard C library (libc.a)

Syntax

# include <sys/rset.h>
int ra_getrset (rstype, rsid, flags, rset)
rstype_t rstype;
rsid_t rsid;
unsigned int flags;
rsethandle_t rset;

Description

The ra_getrset subroutine returns the resource set to which a specified work component is attached.

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 resource set attached to the current process or the current kernel thread, respectively, is requested.

The following return values from the ra_getrset subroutine indicate the type of resource set returned:
  • A value of RS_EFFECTIVE_RSET indicates the process was explicitly attached to the resource set. This may have been done with the ra_attachrset subroutine.
  • A value of RS_PARTITION_RSET indicates the process was not explicitly attached to a resource set. However, the process had an explicitly set partition resource set. This may be set with the rs_setpartition subroutine or through the use of Workload Manager (WLM) work classes with resource sets.
  • A value of RS_DEFAULT_RSET indicates the process was not explicitly attached to a resource set nor did it have an explicitly set partition resource set. The system default resource set is returned.
  • A value of RS_THREAD_RSET indicates the kernel thread was explicitly attached to the resource set. This might have been done with the ra_attachrset subroutine.
  • A value of RS_THREAD_PARTITION_RSET indicates that the kernel thread was not explicitly attached to a resource set. However, the thread had an explicitly set partition resource set. This was set through the use of WLM work classes with resource sets.

Parameters

Item Description
rstype Specifies the type of the work component whose resource set attachment is requested. This parameter must be the following value, defined in rset.h:
  • R_PROCESS: existing process
  • R_THREAD: existing kernel thread
rsid Identifies the work component whose resource set attachment is requested. This parameter must be the following:
  • Process ID (for rstype of R_PROCESS): set the rsid_t at_pid field to the desired process' process ID.
  • Kernel thread ID (for rstype of R_THREAD): set the rsid_t at_tid field to the desired kernel thread's thread ID.
flags Reserved for future use. Specify as 0.
rset Specifies the resource set to receive the work component's resource set.

Return Values

If successful, a value of RS_EFFECTIVE_RSET, RS_PARTITION_RSET, RS_THREAD_RSET, RS_THREAD_PARTITION_RSET, or RS_DEFAULT_RSET is returned. If unsuccessful, a value of -1 is returned and the errno global variable is set to indicate the error.

Error Codes

The ra_getrset subroutine is unsuccessful if one or more of the following are true:
Item Description
EINVAL One of the following is true:
  • The flags parameter contains an invalid value.
  • The rstype parameter contains an invalid type qualifier.
EFAULT Invalid address.
ESRCH The process or kernel thread identified by the rstype and rsid parameters does not exist.