/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1989-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* process status stream PSS_METHOD_getprocs implementation
*/
#include "psslib.h"
#if PSS_METHOD != PSS_METHOD_getprocs
#else
#include <procinfo.h>
#define procsinfo procsinfo64
#else
#define PSS_pri 0
#endif
#define PSS_gid 0
#define PSS_npid 0
#define PSS_proc 0
#define PSS_sched 0
#define PSS_tgrp 0
typedef struct State_s
{
int last;
int index;
int count;
} State_t;
static int
{
{
return -1;
}
return 1;
}
static int
{
if (pid)
{
return -1;
}
else
{
return 0;
state->count = getprocs(state->entry, sizeof(state->entry[0]), NiL, 0, &pss->pid, elementsof(state->entry));
{
return -1;
return 0;
}
}
return 1;
}
static int
{
{
case SACTIVE:
break;
case SIDL:
break;
case SSTOP:
break;
case SSWAP:
break;
case SZOMB:
break;
default:
break;
}
return 1;
}
static int
{
char* s;
int i;
{
{
{
s[i] = 0;
s++;
}
}
if (fields & PSS_command)
{
{
s[i] = 0;
s++;
}
}
}
#if PSS_pri
#endif
return 1;
}
static Pssmeth_t getprocs_method =
{
"getprocs",
"[-version?@(#)$Id: pss getprocs (AT&T Research) 2004-02-29 $\n]"
"[-author?Glenn Fowler <gsf@research.att.com>]",
0,
0,
0,
0
};
#endif