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

Technical Reference: Base Operating System and Extensions, Volume 2

ra_attachrset Subroutine

Purpose

Attaches a work component to a resource set.

Library

Standard C library (libc.a)

Syntax

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

Description

The ra_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.

Dynamic Processor Deallocation and DLPAR may invalidate the processor attachment that is being specified. A program must become DLPAR Aware to resolve this problem.

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

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

The ra_attachrset subroutine is unsuccessful if 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

ra_fork Subroutine, ra_exec Subroutine, ra_getrset Subroutine, and ra_detachrset Subroutine.

The Dynamic Logical Partitioning article in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

The dr_reconfig system call in AIX 5L Version 5.2 Technical Reference: Kernel and Subsystems Volume 1.

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