Performs a set of operations on one or two resource sets.
Standard C library (libc.a)
#include <sys/rset.h>
int rs_op (command, rset1, rset2, flags, id)
unsigned int command;
rsethandle_t rset1, rset2;
unsigned int flags;
unsigned int id;
The rs_op subroutine performs the operation specified by the command parameter on resource set rset1 or both resource sets rset1 and rset2.
Item | Description |
---|---|
command | Specifies the operation to apply to the resource
sets identified by rset1 and rset2. One of the following
values, defined in rset.h, can be used:
|
rset1 | Specifies the resource set handle for the first of the resource sets involved in the command operation. |
rset2 | Specifies the resource set handle for the second of the resource sets involved in the command operation. This resource set is also used, on return, to store the result of the operation, and its previous content is lost. The rset2 parameter is ignored on the RS_ISEMPTY, RS_TESTRESOURCE, RS_ADDRESOURCE, and RS_DELRESOURCE commands. |
flags | When combined with the RS_COPY command,
the flags parameter specifies the type of the resources that
will be copied from rset1 to rset2. When combined with
an RS_FIRST or an RS_NEXT command, the flags parameter specifies
the type of the resource that will be retrieved from rset1.
This parameter is constructed by logically ORing one or more of the
following values, defined in rset.h:
If none of the above are specified for flags, R_ALL_RESOURCES is assumed. |
id | On the RS_TESTRESOURCE, RS_ADDRESOURCE, and RS_DELRESOURCE commands, the id parameter specifies the index of the resource to be tested, added, or deleted. This parameter is ignored on the other commands. |
If successful, the commands RS_ISEMPTY, RS_ISEQUAL, RS_ISCONTAINED, and RS_TESTRESOURCE return 0 if the tested condition is not met and 1 if the tested condition is met. All other commands return 0 if successful. If unsuccessful, a value of -1 is returned and the errno global variable is set to indicate the error.
The rs_op subroutine is unsuccessful if one or more of the following are true:
Item | Description |
---|---|
EINVAL | If one of the following is true:
|
EFAULT | Invalid address. |