ra_exec Subroutine
Purpose
Executes a file and attaches it to a given resource.
Library
Standard C library (libc.a)
Syntax
#include <sys/rset.h>
int ra_execl(rstype, rsid, flags, path, argument0 [,argument1,...], 0)
rstype_t rstype;
rsid_t rsid;
unsigned int flags;
const char * path, argument0, argument1,...;
int ra_execle(rstype, rsid, flags, path, argument0[,argument1,...], 0, envptr)
rstype_t rstype;
rsid_t rsid;
unsigned int flags;
const char * path, argument0, argument1,...;
char * const envptr[];
int ra_execlp(rstype, rsid, flags, File, argument0[,argument1,...], 0)
rstype_t rstype;
rsid_t rsid;
unsigned int flags;
const char * File, argument0, argument1,...;
int ra_execv (rstype, rsid, flags, path, argumentv)
rstype_t rstype;
rsid_t rsid;
unsigned int flags;
const char * path;
char * const argumentv[];
int ra_execve (rstype, rsid, flags, path, argumentv, envptr)
rstype_t rstype;
rsid_t rsid;
unsigned int flags;
const char * path;
char * const argumentv[], envptr[];
int ra_execvp (rstype, rsid, flags, File, argumentv)
rstype_t rstype;
rsid_t rsid;
unsigned int flags;
const char * File;
char * const argumentv[];
int ra_exect(rstype, rsid, flags, path, argumentv, envptr)
rstype_t rstype;
rsid_t rsid;
unsigned int flags;
char * path, argumentv, envptr[];
Description
The ra_exec subroutine in all its forms, executes a new program in the calling process, and attaches the process to the resource specified by the rstype and rsid parameters. The ra_exec subroutine can attach the new process to a resource set (rstype R_RSET) or to an sradid (rstype R_SRADID).
- The resource set must contain processors that are available in the system.
- The process must either have root authority or have CAP_NUMA_ATTACH capability.
- The calling thread must not have a bindprocessor binding to a processor.
- The resource set must be contained in (be a subset of ) the process' partition 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.
- All offline processors are ignored.
- If all the hardware threads (processors) of a physical processor (when running in simultaneous multithreading mode, there will be more than one active hardware thread per physical processor) are not included in the specified resource set, the other processors of the processor are ignored when constructing the ST resource set.
- Only one processor (hardware thread) resource per physical processor is included in the ST resource set.
Parameters
The ra_exec subroutine has the same parameters as the exec subroutine, with the addition of the following new parameters:
Item | Description |
---|---|
rstype | Specifies the type of resource the new process
image will be attached to. This parameter must be one of the following:
|
rsid | Identifies the resource the new process image
will be attached to:
|
flags | Specifies the policy to use for the process. For rstype R_RSET, the R_ATTACH_STRSET flag indicates that the process is to be scheduled with a single-threaded policy (only on one hardware thread per physical processor). All other flag bits are reserved and must be specified as 0. |
Return Values
The ra_exec subroutine's return values are the same as the exec subroutine's return values.
Error Codes
The ra_exec subroutine's error codes are the same as the exec subroutine's error codes, with the addition of the following error codes:
Item | Description |
---|---|
EINVAL | One of the following is true:
|
ENODEV | The resource set specified by the rset parameter does not contain any available processors, or the R_ATTACH_STRSET flags parameter is specified and the constructed ST resource set does not have any available processors. |
ENODEV | An invalid rsid SRADID is specified. |
EFAULT | Invalid address. |
EPERM | One of the following is true:
|
ENOTSUP | An attempt to attach an SRADID is made and ENHANCED_AFFINITY is disabled. |