kra_creatp Subroutine

Purpose

Creates a new kernel process and attaches it 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 it to a resource set. The kra_creatp kernel service attaches the new kernel process to the resource set specified by the rstype and rsid parameters.

The kra_creatp kernel service is similar to the creatp kernel service. See the creatp Kernel Service for details on creating a new kernel process.

The following conditions must be met to successfully attach a kernel process to a resource set:
  • The resource set must contain processors that are available in the system.
  • The calling 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 the calling process' partition resource set.
Note: When the creatp kernel service is used, the new kernel process inherits its parent's resource set attachments.

Parameters

Item Description
pid Pointer to a pid_t field to receive the process ID of the new kernel process.
rstype Specifies the type of resource the new process will be attached to. This parameter must be the following value, defined in rset.h.
  • R_RSET: resource set.
rsid Identifies the resource set the new process will be attached to.
  • Resource set ID (for rstype of R_RSET): set the rsid_t at_rset field to the desired resource set.
flags Reserved for future use. Specify as 0.

Return Values

Upon successful completion, the kra_creatp kernel service returns a 0. If unsuccessful, one or more of the following are true:

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