Returns a system resource allocation domain (RAD) contained in an input resource set.
Standard C library (libc.a)
#include <sys/rset.h>
int rs_getrad (rset, rad, sdl, index, flags)
rsethandle_t rset, rad;
unsigned int sdl;
unsigned int index;
unsigned int flags;
The rs_getrad subroutine returns a system RAD at a specified system detail level and index that is contained in an input resource set. If only some of the resources in the specified system RAD are contained in the input resource set, only the resources in both the system RAD and the input resource set are returned.
The input resource set is specified by the rset parameter. The output system RAD is identified by the rad parameter.
The system RAD is specified by system detail level sdl and index number index. If only a portion of the specified RAD is contained in rset, only that portion is returned in rad.
The rset and rad parameters must be allocated (using the rs_alloc subroutine) prior to calling the rs_getrad subroutine.
Item | Description |
---|---|
rset | Specifies a resource set handle for the input resource set. |
rad | Specifies a resource set handle to receive the desired system RAD (contained in the rset parameter). |
sdl | Specifies the system detail level of the desired system RAD. |
index | Specifies the index of the system RAD that should be returned from among those at the specified sdl. This parameter must belong to the [0, rs_numrads(rset, sdl, flags)- 1] interval. |
flags | The following flags (defined in rset.h)
can be used to modify the default behavior of the rs_getrad subroutine.
By default, the rs_getrad subroutine empties the resource set
specified by rad before the specified RAD is retrieved.
|
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_getrad subroutine is unsuccessful if one or more of the following are true:
Item | Description |
---|---|
EINVAL | One of the following is true:
|
EFAULT | Invalid address. |