cpusetGetTrustPerm(3x)cpusetGetTrustPerm(3x)NAMEcpusetGetTrustPerm - get the Trusted Security permissions for a cpuset
SYNOPSIS
#include <cpuset.h>
int cpusetGetTrustPerm(char *qname, struct acl *acc,
struct acl *def, mac_label *mac);
DESCRIPTION
The cpusetGetTrustPerm function is used to obtain the trusted security
attributes of the cpuset permission file. The permissions of this file
are used to define the access permissionf for the cpuset. The ACL that
defines access to the cpuset is returned in the memory location specified
by the acc argument. The ACL that defines default security attributes is
returned in the memory location specified by the def argument. The MAC
label is returned in the memory location specified by the mac argument.
Only processes running with a user ID or group ID that has read access
permissions on the permissions file can successfully execute this
function. The qname argument is the name of the specified cpuset.
The function returns a status to indicate success or failure.
EXAMPLES
This example obtains the trusted security attributes.
char *qname = "mpi_set";
struct acl acc, def;
mac_label mac;
char *macstr;
memset(acc, 0, sizeof(struct acl));
memset(def, 0, sizeof(struct acl));
memset(mac, 0, sizeof(mac_label));
/* Get the list of CPUs else print error & exit */
if (!cpusetGetTrustPerm(qname, &acc, &def, &mac)) {
perror("cpusetGetTrustPerm");
exit(1);
}
if (acc.acl_cnt != ACL_NOT_PRESENT) {
printf("Access ACL mode (%s)0, ACL_to_str(acc));
}
if (def.acl_cnt != ACL_NOT_PRESENT) {
printf("Default ACL mode (%s)0, ACL_to_str(def));
}
if (mac.ml_msen_type) {
printf("MAC label (%s)0, mac_to_text(&mac, (size_t *) NULL);
}
Page 1
cpusetGetTrustPerm(3x)cpusetGetTrustPerm(3x)NOTEScpusetGetTrustPerm is found in the library "libcpuset.so", and will be
loaded if the option -lcpuset is used with cc(1) or ld(1).
SEE ALSOcpuset(1), cpusetSetTrustPerm(3x), cpuset(5).
DIAGNOSTICS
If successful, cpusetGetTrustPerm returns 1. If cpusetGetTrustPerm
fails, it returns 0 and errno is set to indicate the error. The possible
values for errno include those values as set by sysmp(2) and sbrk(2).
Page 2