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

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

Contents


cpusetGetName(3x)					     cpusetGetName(3x)


NAME    [Toc]    [Back]

     cpusetGetName - get the name of the cpuset	to which a process is attached

SYNOPSIS    [Toc]    [Back]

     #include <cpuset.h>

     cpuset_NameList_t *cpusetGetName(pid_t pid);

DESCRIPTION    [Toc]    [Back]

     The cpusetGetName function	is used	to obtain the name of the cpuset to
     which the specified process has been attached.  The pid argument
     specifies the process ID.	Currently, the only valid value	for pid	is 0,
     which returns the name of the cpuset to which the current process is
     attached.

     The function returns a pointer to a structure of type cpuset_NameList_t
     (defined in <cpuset.h>).  The function cpusetGetName 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.  In the case of
     cpusetGetName this	member will should only	contain	the values of 0	and 1.

     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.






									Page 1






cpusetGetName(3x)					     cpusetGetName(3x)


EXAMPLES    [Toc]    [Back]

     This example obtains cpuset name or CPU ID	to which the current process
     is	attached:

	       cpuset_NameList_t *name;

	       /* Get the name else print error	& exit */
	       if ( !(name = cpusetGetName(0)) ) {
		   perror("cpusetGetName");
		   exit(1);
	       }
	       if (name->count == 0) {
		   printf("Current process not attached\n");
	       } else {
		   if (name->status[0] == CPUSET_CPU_NAME) {
		       printf("Current process attached	to"
			       " CPU_ID[%s]\n",
			       name->list[0]);
		   } else {
		       printf("Current process attached	to"
			       " CPUSET[%s]\n",
			       name->list[0]);
		   }
	       }
	       cpusetFreeNameList(name);

NOTES    [Toc]    [Back]

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

DIAGNOSTICS    [Toc]    [Back]

     If	successful, cpusetGetName returns a pointer to a cpuset_NameList_t
     structure.	 If cpusetGetName 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), sbrk(2), and the following:

     EINVAL    [Toc]    [Back]
	  Invalid value	for pid	was supplied.  Currenlty only 0	is accepted to
	  obtain the cpuset name that the current process is attached to.

     ERANGE    [Toc]    [Back]
	  Number of CPUs configured on the system is not a value greater than
	  or equal to 1.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
cpusetGetPIDList IRIX get a list of all PIDs attached to a cpuset
ldr_xdetach Tru64 Detache from an attached process
ct Tru64 Dials an attached terminal and issues a login process
cpusetDetachPID IRIX detach a specific process from a cpuset
cpusetAttach IRIX attach the current process to a cpuset
cpusetAttachPID IRIX attach a specific process to a cpuset
CSSM_GetModuleGUIDFromHandle Tru64 Get GUID of the attached module (CDSA)
CSSM_ListAttachedModuleManagers Tru64 Get a list of GUIDs for the attached module manager(CDSA)
cpusetCreate IRIX create a cpuset
cpusetDestroy IRIX destroy a cpuset
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service