rs_getassociativity Subroutine

Purpose

Gets the hardware associativity values for a resource.

Library

Standard C library (libc.a)

Syntax

#include <sys/rset.h>
int rs_getassociativity (type, id, assoc_array, array_size)
unsigned int type;
unsigned int id;
unsigned int *assoc_array;
unsigned int array_size;

Description

The rs_getassociativity subroutine returns the array of hardware associativity values for a specified resource.

This is a special purpose subroutine intended for specialized root applications needing the hardware associativity value information. The rs_getinfo, rs_getrad, and rs_numrads subroutines are provided for non-root applications to discover system hardware topology.

The calling process must have root authority to get hardware associativity values.

Parameters

Item Description
type Specifies the resource type whose associativity values are requested. The only value supported to retrieve values for a processor is R_PROCS.
id Specifies the logical resource id whose associativity values are requested.
assoc_array Specifies the address of an array of unsigned integers to receive the associativity values.
array_size Specifies the number of unsigned integers in assoc_array.

Return Values

If successful, a value of 0 is returned. The assoc_array parameter array contains the resource's associativity values. The first entry in the array indicates the number of associativity values returned. If the hardware system does not provide system topology data, a value of 0 is returned in the first array entry. If unsuccessful, a value of -1 is returned and the errno global variable is set to indicate the error.

Error Codes

The rs_getassociativity subroutine is unsuccessful if one or more of the following are true:
Item Description
EINVAL One of the following occurred:
  • The array_size parameter was specified as 0.
  • An invalid type parameter was specified.
ENODEV The resource specified by the id parameter does not exist.
EFAULT Invalid address.
EPERM The calling process does not have root authority.