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

Technical Reference: Kernel and Subsystems, Volume 1

krs_alloc Subroutine

Purpose

Allocates a resource set and returns its handle.

Syntax

#include <sys/rset.h>
int krs_alloc (rset, flags)
rsethandle_t *rset;
unsigned int flags;

Description

The krs_alloc subroutine allocates a resource set and initializes it according to the information specified by the flags parameter. The value of the flags parameter determines how the new resource set is initialized.

Parameters

rset Points to an rsethandle_t where the resource set handle is stored on successful completion.
flags Specifies how the new resource set is initialized. It takes one of the following values, defined in rset.h:
  • RS_EMPTY (or 0 value): The resource set is initialized to contain no resources.
  • RS_SYSTEM: The resource set is initialized to contain available system resources.
  • RS_ALL: The resource set is initialized to contain all resources.
  • RS_PARTITION: The resource set is initialized to contain the resources in the caller's process partition resource set.

Return Values

Upon successful completion, the krs_alloc subroutine returns a 0. If unsuccessful, one or more of the following is returned:

EINVAL The flags parameter contains an invalid value.
ENOMEM There is not enough space to create the data structures related to the resource set.

Related Information

krs_free Subroutine, krs_getinfo Subroutine, and krs_init Subroutine.

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