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

Technical Reference: Base Operating System and Extensions, Volume 2

rs_alloc Subroutine

Purpose

Allocates a resource set and returns its handle.

Library

Standard C library (libc.a)

Syntax

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

Description

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

The handle for the new resource set is returned by the subroutine.

Parameters

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

On successful completion, a resource set handle for the new resource set is returned. Otherwise, a value of 0 is returned and the errno global variable is set to indicate the error.

Error Codes

The rs_alloc subroutine is unsuccessful if one or more of the following are true:

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

rs_free Subroutine, rs_getinfo Subroutine, and rs_init Subroutine.

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