*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> cpusetGetNameList (3x)              
Title
Content
Arch
Section
 

Contents


cpusetGetNameList(3x)					 cpusetGetNameList(3x)


NAME    [Toc]    [Back]

     cpusetGetNameList - get the list of names for all defined cpusets

SYNOPSIS    [Toc]    [Back]

     #include <cpuset.h>

     cpuset_NameList_t *cpusetGetNameList(void);

DESCRIPTION    [Toc]    [Back]

     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    [Toc]    [Back]

     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.





									Page 1






cpusetGetNameList(3x)					 cpusetGetNameList(3x)



	       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    [Toc]    [Back]

     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    [Toc]    [Back]

      
      
     cpuset(1),	cpusetFreeNameList(3x),	cpuset(5).

DIAGNOSTICS    [Toc]    [Back]

     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).


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
DtWsmGetWorkspaceList HP-UX get the names of the currently defined workspaces
xlsatoms Tru64 list interned atoms defined on server
xlsatoms IRIX list interned atoms defined on server
cpuset IRIX overview of cpusets
DtDtsFreeDataTypeNames HP-UX free a list of data type names
attr_list IRIX list the names of the user attributes of a filesystem object
tt_session_propname HP-UX returns an element of the list of property names for a session
DL_GetDbNames Tru64 Get list of logical data store names (CDSA)
CSSM_DL_GetDbNames Tru64 Get list of logical data store names (CDSA)
list_clearinghouse HP-UX Displays a list of all the clearinghouses whose names match the specified clearinghouse name
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service