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

  man pages->IRIX man pages -> cpusetGetPIDList (3x)              


cpusetGetPIDList(3x)					  cpusetGetPIDList(3x)

NAME    [Toc]    [Back]

     cpusetGetPIDList -	get a list of all PIDs attached	to a cpuset

SYNOPSIS    [Toc]    [Back]

     #include <cpuset.h>

     cpuset_PIDList_t *cpusetGetPIDList(char *qname);

DESCRIPTION    [Toc]    [Back]

     The cpusetGetPIDList function is used to obtain a list of the PIDs	for
     all processes currently attached to the specified cpuset. Only processes
     with a user ID or group ID	that has read permissions on the permissions
     file can successfully execute this	function.

     The qname argument	is the name of the cpuset to which the current process
     should be attached.

     The function returns a pointer to a structure of type cpuset_PIDList_t
     (defined in <cpuset.h>).  The function cpusetGetPIDList allocates the
     memory for	the structure and the user is responsible for freeing the
     memory using the function cpusetFreePIDList(3x).  The cpuset_PIDList_t
     structure looks similar to	this:

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

     count is the number of PID	values in the list.  list references an	array
     that holds	the list of PID	values.	 The memory for	list is	allocated when
     the cpuset_PIDList_t is allocated and it is released when the
     cpuset_PIDList_t structure	is released.

EXAMPLES    [Toc]    [Back]

     This example obtains the list of PIDs attached to the cpuset mpi_set and
     prints out	the PID	values.

	       char		*qname = "mpi_set";
	       cpuset_PIDList_t	*pids;

	       /* Get the list of PIDs else print error	& exit */
	       if ( !(pids = cpusetGetPIDList(qname)) )	{
	       if (pids->count == 0) {
		   printf("CPUSET[%s] has 0 processes attached\n",
	       } else {
		   int i;

									Page 1

cpusetGetPIDList(3x)					  cpusetGetPIDList(3x)

		   printf("CPUSET[%s] attached PIDs:\n",
		       for (i =	0; i < pids->count; i++)
			   printf("PID[%d]0, pids->list[i]);

NOTES    [Toc]    [Back]

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

DIAGNOSTICS    [Toc]    [Back]

     If	successful, cpusetGetPIDList returns a pointer to a cpuset_PIDList_t
     structure.	 If cpusetGetPIDList fails, it returns NULL and	errno is set
     to	indicate the error.  The possible values for errno are the same	as the
     values set	by sysmp(2) and	sbrk(2).

									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
cpusetGetName IRIX get the name of the cpuset to which a process is attached
fuser Tru64 Reports PIDs and UIDs for files, file systems and/or the devices attached to them.
CSSM_ListAttachedModuleManagers Tru64 Get a list of GUIDs for the attached module manager(CDSA)
cpusetGetCPUList IRIX get the list of all CPUs assigned to a cpuset
ttyunlock NetBSD locks based on files containing PIDs
pidlock NetBSD locks based on files containing PIDs
ttylock NetBSD locks based on files containing PIDs
ldr_xdetach Tru64 Detache from an attached process
CSSM_GetModuleGUIDFromHandle Tru64 Get GUID of the attached module (CDSA)
ct Tru64 Dials an attached terminal and issues a login process
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service