cpusetGetNameList(3x) cpusetGetNameList(3x) NAME cpusetGetNameList - get the list of names for all defined cpusets SYNOPSIS #include <cpuset.h> cpuset_NameList_t *cpusetGetNameList(void); DESCRIPTION The cpusetGetNameList function is used to obtain a list of the names for all the cpusets on the system. The function returns a pointer to a structure of type cpuset_NameList_t (defined in <cpuset.h>). The function cpusetGetNameList allocates the memory for the structure and all of its associated data. The user is responsible for freeing the memory using the function cpusetFreeNameList(3x). The cpuset_NameList_t structure is defined as follows: typedef struct { int count; char **list; int *status; } cpuset_NameList_t; count is the number of cpuset names in the list. list references the list of names. status is a list of status flags that indicate the status of the corresponding cpuset name in list. The following flag values may be used: CPUSET_QUEUE_NAME Indicates that the corresponding name in list is the name of a cpuset queue. CPUSET_CPU_NAME Indicates that the corresponding name in list is the CPU ID for a restricted CPU. The memory for list and status is allocated when the cpuset_NameList_t is allocated and it is released when the cpuset_NameList_t structure is released. EXAMPLES This example obtains the list of names for all cpuset queues configured on the system. The list of cpusets or restricted CPU IDs is then printed. cpuset_NameList_t *names; /* Get the list of names else print error & exit */ if ( !(names = cpusetGetNameList()) ) { perror("cpusetGetNameList"); exit(1); } if (names->count == 0) { printf("No defined CPUSETs or restricted CPUs\n"); } else { int i; printf("CPUSET and restricted CPU names:\n"); for (i = 0; i < names->count; i++) { if (names->status[i] == CPUSET_CPU_NAME) { printf("CPU_ID[%s]\n", names->list[i]); } else { printf("CPUSET[%s]\n", names->list[i]); } } } cpusetFreeNameList(names); NOTES cpusetGetNameList is found in the library "libcpuset.so", and will be loaded if the option -lcpuset is used with cc(1) or ld(1). SEE ALSO cpuset(1), cpusetFreeNameList(3x), cpuset(5). DIAGNOSTICS If successful, cpusetGetNameList returns a pointer to a cpuset_NameList_t structure. If cpusetGetNameList fails, it returns NULL and errno is set to indicate the error. The possible values for errno include those values set by sysmp(2) and sbrk(2). Page 2