rs_discardname Subroutine

Purpose

Discards a resource set definition from the system resource set registry.

Library

Standard C library (libc.a)

Syntax

#include <sys/rset.h>
int rs_discardname(namespace, rsname)
char *namespace, *rsname;

Description

The rs_discardname subroutine discards from the system global repository the definition of the resource set. The resource set is identified by the namespace and rsname parameters. The specified resource set is removed from the registry, and can no longer be shared with other applications.

In order to be able to discard a name from the global repository, the calling process must have root authority or CAP_NUMA_ATTACH capability, and an effective user ID equal to that of the rsname parameter's creator. CAP_NUMA_ATTACH allows non-root users to create or remove an exclusive rset.

The rs_discardname subroutine is used to remove an exclusive rset. When an exclusive rset is removed, the state of CPUs in that rset is modified so that those CPUs can run any work on the system. Root authority is required to remove an exclusive rset. See Exclusive use processor resource sets in Operating system and device management and the rmrset command for more information.

Parameters

Item Description
namespace Points to a null terminated string corresponding to the name space within which rsname should be found.
rsname Points to a null terminated string corresponding to the name of a registered resource set to be discarded.

Return Values

If successful, a value of 0 is returned. Otherwise, a value of -1 is returned, and the errno global variable is set to indicate the error.

Error Codes

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

Item Description
EINVAL One of the following is true:
  • The rsname parameter contains a null value.
  • The namespace parameter contains a null value.
  • The rsname or namespace parameters point to an invalid name.
  • The name length is null or greater than the RSET_NAME_SIZE constant (defined in rset.h), or the name contains invalid characters.
EPERM One of the following is true:
  • The calling process has neither root authority nor CAP_NUMA_ATTACH capability.
  • The calling process has neither the same user ID as the creator of the rsname definition nor root authority .
  • The namespace parameter starts with sys. This name space is reserved for system use.
EFAULT Invalid address, and/or exceptions outside errno range.