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

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

Contents


cpusetGetCPUList(3x)					  cpusetGetCPUList(3x)


NAME    [Toc]    [Back]

     cpusetGetCPUList -	get the	list of	all CPUs assigned to a cpuset

SYNOPSIS    [Toc]    [Back]

     #include <cpuset.h>

     cpuset_CPUList_t *cpusetGetCPUList(char *qname);

DESCRIPTION    [Toc]    [Back]

     The cpusetGetCPUList function is used to obtain the list of the CPUs
     assigned to the specified cpuset.	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 pointer to a structure of type cpuset_CPUList_t
     (defined in <cpuset.h>).  The function cpusetGetCPUList allocates the
     memory for	the structure and the user is responsible for freeing the
     memory using the function cpusetFreeCPUList(3x).  The cpuset_CPUList_t
     structure looks similar to	this:

	       typedef struct {
		   int	  count;
		   pid_t  *list;
	       } cpuset_CPUList_t;


     count is the number of CPU	IDs in the list.  list references the memory
     array that	holds the list of CPU IDs.  The	memory for list	is allocated
     when the cpuset_CPUList_t is allocated and	it is released when the
     cpuset_CPUList_t structure	is released.

EXAMPLES    [Toc]    [Back]

     This example obtains the list of CPUs asigned to the cpuset mpi_set and
     prints out	the CPU	ID values.

	       char		*qname = "mpi_set";
	       cpuset_CPUList_t	*cpus;

	       /* Get the list of CPUs else print error	& exit */
	       if ( !(cpus = cpusetGetCPUList(qname)) )	{
		   perror("cpusetGetCPUList");
		   exit(1);
	       }
	       if (cpus->count == 0) {
		   printf("CPUSET[%s] has 0 assigned CPUs\n",
			   qname);
	       } else {
		   int i;

		   printf("CPUSET[%s] assigned CPUs:\n",
			   qname);



									Page 1






cpusetGetCPUList(3x)					  cpusetGetCPUList(3x)



		       for (i =	0; i < cpus->count; i++)
			   printf("CPU_ID[%d]\n", cpus->list[i]);
	       }
	       cpusetFreeCPUList(cpus);

NOTES    [Toc]    [Back]

     cpusetGetCPUList 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),	cpusetFreeCPUList(3x), cpuset(5).

DIAGNOSTICS    [Toc]    [Back]

     If	successful, cpusetGetCPUList returns a pointer to a cpuset_CPUList_t
     structure.	 If cpusetGetCPUList fails, it returns NULL and	errno is set
     to	indicate the error.  The possible values for errno include those
     values as set by sysmp(2) and sbrk(2).


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
codconfig Tru64 Configures Compaq Capacity on Demand (CCoD) with the list of initially used (purchased) CPUs
cpusetGetPIDList IRIX get a list of all PIDs attached to a cpuset
do_config Tru64 EISA/ISA: Initializes the device to its assigned configuration
vc HP-UX substitutes assigned values in place of identification keywords.
cpuset IRIX define and manage a set of CPUs
cpusetGetCPUCount IRIX obtain the number of CPUs configured on the system
onlinediag IRIX run diagnostic tests on cpus to test floating point units.
cpusetCreate IRIX create a cpuset
cpusetDestroy IRIX destroy a cpuset
cpuset IRIX cpuset configuration files
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service