[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Kernel and Subsystems, Volume 1

kra_attachrset Subroutine

Purpose

Attaches a work component to a resource set.

Syntax

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

Description

The kra_attachrset subroutine attaches a work component specified by the rstype and rsid parameters to a resource set specified by the rset parameter.

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 successfully attach a process to a resource set:

If any of these conditions are not met, the attachment will fail.

Once a process is attached to a resource set, the threads in the process will only run on processors contained in the resource set.

Parameters

rstype Specifies the type of work component to be attached to the resource set specified by the rset parameter. The rstype parameter must be the following value, defined in rset.h:
  • R_PROCESS: existing process
rsid Identifies the work component to be attached to the resource set specified by the rset parameter. The rsid 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.
rset Specifies which work component (specified by the rstype and rsid parameters) to attach to the resource set.
flags Reserved for future use. Specify as 0.

Return Values

Upon successful completion, the kra_attachrset subroutine returns a 0. If unsuccessful, one or more of the following are true:

EINVAL One of the following is true:
  • The flags parameter contains an invalid value.
  • The rstype parameter contains an invalid type qualifier.
ENODEV The resource set specified by the rset parameter does not contain any available processors.
ESRCH The process identified by the rstype and rsid parameters does not exist.
EPERM One of the following is true:
  • The resource set specified by the rset parameter is not included in the partition resource set of the process identified by the rstype and rsid parameters.
  • The calling process has neither root authority nor CAP_NUMA_ATTACH attachment privilege.
  • The calling process has neither root authority nor the same effective user ID as the process identified by the rstype and rsid parameters.
  • The process identified by the rstype and rsid parameters has one or more threads with a bindprocessor processor binding.

Related Information

kra_getrset Subroutine, and kra_detachrset Subroutine.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]