rs_getnameattr Subroutine

Purpose

Retrieves the access control information of a resource set definition in the system resource set registry.

Library

Standard C library (libc.a)

Syntax

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

Description

The rs_getnameattr subroutine retrieves from the system resource set registry the access control information of the resource set definition specified by the namespace and rsname parameters.

The owner ID, group ID, and access control information of the specified resource set are stored in the structure pointed to by the attr parameter.

Note: No special authority or access permission is required to query this information.

Parameters

Item Description
namespace Points to a null terminated string corresponding to the name space within which the rsname parameter should be found.
rsname Points to a null terminated string corresponding to the name the information should be retrieved for.
attr Points to an rs_attributes_t structure containing the owner, group, and mode fields, which will be filled by the subroutine. The mode field in the rs_attributes_t structure is used to store the access permissions, and is constructed by logically ORing one or more of the following values, defined in rset.h:
  • RS_IRUSR: Gives read rights to the name's owner.
  • RS_IWUSR: Gives write rights to the name's owner.
  • RS_IRGRP: Gives read rights to users of the same group as the name's owner.
  • RS_IWGRP: Gives write rights to users of the same group as the name's owner.
  • RS_IROTH: Gives read rights to others.
  • RS_IWOTH: Gives write rights to others.

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.

Return Values

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.

Error Codes

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

Item Description
EINVAL If one of the following is true:
  • The rsname parameter is a null pointer.
  • The namespace parameter is a null pointer.
  • The rsname or namespace parameters point to an invalid name. The name length is 0 or greater than the RSET_NAME_SIZE constant (defined in rset.h), or the rsname parameter contains invalid characters.
ENOENT The rsname parameter could not be found in the name space identified by the namespace parameter.
EFAULT Invalid address.