kra_creatp Kernel Service

Purpose

Creates a new kernel process and attaches the new kernel process to a resource set.

Syntax

#include <sys/rset.h>
int kra_creatp (pid, rstype, rsid, flags)
pid_t *pid;
rstype_t rstype;
rsid_t rsid;
unsigned int flags;

Description

The kra_creatp kernel service creates a new kernel process and attaches the new kernel process to a resource set specified by the rstype and rsid parameters.

The kra_creatp kernel service can be used similar to the creatp kernel service for creating a new kernel process.

To successfully attach a kernel process to a resource set, the following conditions must be met:
  • The resource set must contain processors that are available in the system.
  • The calling process must either have the 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 the partition resource set of the calling process.
Note: When the kra_creatp kernel service is used, the new kernel process inherits resource set attachments of the parent kernel process, unless a value is specified for the R_NOINHERIT flag.

Parameters

Item Description
pid Pointer to a pid_t field to receive the process ID of the new kernel process.
rstype Specifies the resource set type to which the new kernel process will be attached. As defined in the rset.h file, this parameter must be set to the following value:

R_RSET: resource set.

rsid Identifies the resource set to which the new kernel process will be attached. This rsid parameter accepts the following value:

Resource set ID (for the rstype parameter value of R_RSET): set the rsid_t at_rset field to the resource set that you want.

flags Specifies how to create the new kernel process. The flags parameter accepts the following value:

R_NOINHERIT (or specify as 0): The new kernel process does not inherit the resource set attachments of the parent kernel process.

Return Values

Upon successful completion, the kra_creatp kernel service returns a value of zero (0). If unsuccessful, the kra_creatp kernel service returns one of the following errors:

Item Description
EINVAL Indicates one of the following conditions:
  • The rstype parameter contains an invalid type identifier.
  • The flags parameter contains an invalid flag value.
ENODEV The specified resource set does not contain any available processors.
EFAULT Invalid address.
EPERM Indicates one of the following conditions:
  • The calling process has neither the root authority nor the CAP_NUMA_ATTACH attachment privilege.
  • The calling process contains one or more threads with a bindprocessor binding to the processor.
  • The specified resource set is not included in the partition resource set of the calling process.
ENOMEM There is not enough memory available to create a new kernel process.