rs_info Subroutine

Purpose

Retrieves system affinity information.

Library

Standard C library (libc.a)

Syntax

#include <sys/rset.h>
long rs_info(void *out, long command, long arg1, long arg2)

Description

The rs_info subroutine returns affinity system information.

Parameters

Item Description
out Specifies the address where the affinity request information is optionally entered and where output information is returned.
command Specifies the requested affinity information. The command parameter has the following values:
RS_CONTAINING_RAD
Returns the index number of the resource allocation domain at the previous (next lower number) system detail level that contains the resource allocation domain specified by the arg1 and arg2 parameters. The arg1 parameter specifies the system detail level number of requested resource allocation domain. The arg2 parameter specifies the index of the resource allocation domain within the arg1 system detail level. The *out parameter points to an unsigned integer that receives the containing resource allocation domain index.
RS_SRADID_LOADAVG
Returns the dispatcher load average for the available CPUs in a specified SRADID (Scheduler Resource Allocation Domain Identifier). The arg1 parameter specifies the SRADID whose load average is requested. The arg2 parameter specifies the size of the output parameter area provided in the out parameter. The out parameter points to the address of a loadavg_info_t structure to receive the output of the query. The rs_info() subroutine returns the load average and the number of available CPUs in the SRADID in the loadavg_info_t structure.
RS_SRADID_USABLE_LOADAVG
Returns the dispatcher load average for the available CPUs in a specified SRADID that can be used by the calling thread. The arg1 parameter specifies the SRADID whose load average is requested. CPUs in the specified SRADID that the calling thread cannot use due to process or thread resource set attachments or system exclusive resource sets are excluded from the load average calculation. The arg2 parameter specifies the size of the output parameter area provided in the out parameter. The out parameter points to the address of a loadavg_info_t structure to receive the output of the query. The rs_info() subroutine returns the load average and number of usable CPUs in the SRADID in the loadavg_info_t structure.
arg1 Specifies the parameter information that depends on the command parameter.
arg2 Specifies the parameter information that depends on the command parameter.

Return Values

If successful, the requested information 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
EFAULT The read or write of the *out parameter is not successful.
EINVAL One of the following occurred:
  • An invalid command argument is specified.
  • An invalid arg1 or arg2 parameter is specified.