Registers a resource set definition in the system resource set registry.
Standard C library (libc.a)
#include <sys/rset.h>
int rs_registername(rset, namespace, rsname, mode, command)
rsethandle_t rset;
char *namespace, *rsname;
unsigned int mode, command;
The rs_registername subroutine registers in the system resource registry (within the name space identified by namespace) the definition of the resource set identified by the rset handle. The rs_registername subroutine does this by associating with it the name specified by the null terminated string structure pointed to by rsname.
If rsname does not exist, the owner and group IDs of rsname are set to the caller's owner and group IDs, and the access control information for rsname is set according to the mode parameter.
If rsname already exists, its owner and group IDs and its access control information are left unchanged, and the mode parameter is ignored. This name can be shared with any applications to identify a dedicated resource set.
Using the command parameter, you can ask to overwrite or not to overwrite the rsname parameter's registration if it already exists in the global repository within the name space identified by namespace. If rsname already exists within the specified name space and the command parameter is set to not overwrite, an error is reported to the calling process.
The namespace sysxrset is reserved for exclusive rsets. When an exclusive rset is created, the state of CPUs in the rset is modified so that those CPUs only run work that is directed to them. See Exclusive use processor resource sets in AIX® Version 7.1 Operating system and device management and the mkrset command for more information. Root privilege or CAP_NUMA_ATTACH capability is required to create or remove an exclusive rset. An exclusive rset cannot be overwritten.
An application registered resource set definition is non-persistent. It does not persist over a system boot.
Both the namespace and rsname parameters may contain up to 255 characters. They must begin with an ASCII alphanumeric character. Only the period (.), minus (-), and underscore (_) characters can be mixed with ASCII alphanumeric characters within these strings. Moreover, the names are case-sensitive, which means there is a difference between uppercase and lowercase letters in resource set names and name spaces.
Item | Description |
---|---|
rset | Specifies a resource set handle of a resource set a name should be registered for. |
namespace | Points to a null terminated string corresponding to the name space within which rsname will be registered. |
rsname | Points to a null terminated string corresponding to the name registered with the setting of the resource set specified by rset. |
mode | Specifies the bit pattern that determines the
created name access permissions. It is constructed by logically ORing
one or more of the following values, defined in rset.h:
Read privilege for a user means that the user can retrieve a resource set definition (by issuing a call to the rs_getnamedrset subroutine). Write privilege for a user means that the user can redefine a name (by issuing another call to the rs_getnamedrset subroutine). |
command | Specifies whether the rsname parameter's
registration should be overwritten if it already exists in the global
repository. This parameter takes one of the following values, defined
in rset.h:
|
If successful, a value of 0 is returned. If unsuccessful, a value of -1 is returned and the errno global variable is set to indicate the error.
The rs_registername subroutine is unsuccessful if one or more of the following are true:
Item | Description |
---|---|
EINVAL | If one of the following is true:
|
EEXIST | The command parameter is set to RS_DEFINE and rsname already exists in the global repository within the name space identified by namespace. |
ENOMEM | There is not enough space to create the data structures related to the registry of this resource set. |
EPERM | If one of the following is true:
|
EFAULT | Invalid address, and/or exceptions outside errno range. |