summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8dbb7bc)
raw | patch | inline | side by side (parent: 8dbb7bc)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 8 Dec 2009 14:42:23 +0000 (15:42 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 8 Dec 2009 14:42:23 +0000 (15:42 +0100) |
src/processes.c | patch | blob | history |
diff --git a/src/processes.c b/src/processes.c
index bda096a1920dfb25246f1258b67472be779fe4ff..d847b89f2dbb53e03925da5ccce876122f1d7569 100644 (file)
--- a/src/processes.c
+++ b/src/processes.c
/* #endif HAVE_LIBKVM_GETPROCS && HAVE_STRUCT_KINFO_PROC_FREEBSD */
#elif HAVE_PROCINFO_H
+ /* AIX */
int running = 0;
int sleeping = 0;
int zombies = 0;
int blocked = 0;
pid_t pindex = 0;
- tid64_t thindex;
- int i;
- int j;
- int n;
int nprocs;
- int nthreads;
procstat_t *ps;
procstat_entry_t pse;
- char arglist[MAXARGLN+1];
- char *cmdline;
- char *cargs;
ps_list_reset ();
- while ((nprocs = getprocs64(procentry, sizeof(struct procentry64), NULL, sizeof(struct fdsinfo64), &pindex, MAXPROCENTRY)) > 0 )
+ while ((nprocs = getprocs64 (procentry, sizeof(struct procentry64),
+ /* fdsinfo = */ NULL, sizeof(struct fdsinfo64),
+ &pindex, MAXPROCENTRY)) > 0)
{
- for ( i=0; i< nprocs; i++)
+ int i;
+
+ for (i = 0; i < nprocs; i++)
{
+ tid64_t thindex;
+ int nthreads;
+ char arglist[MAXARGLN+1];
+ char *cargs;
+ char *cmdline;
+
if (procentry[i].pi_state == SNONE) continue;
/* if (procentry[i].pi_state == SZOMB) FIXME */
{
if (getargs(&procentry[i], sizeof(struct procentry64), arglist, MAXARGLN) >= 0)
{
+ int n;
+
n = -1;
while (++n < MAXARGLN)
{
pse.num_proc = 1;
thindex=0;
- while ((nthreads = getthrds64(procentry[i].pi_pid, thrdentry, sizeof(struct thrdentry64), &thindex, MAXTHRDENTRY)) > 0)
+ while ((nthreads = getthrds64(procentry[i].pi_pid,
+ thrdentry, sizeof(struct thrdentry64),
+ &thindex, MAXTHRDENTRY)) > 0)
{
+ int j;
+
for (j=0; j< nthreads; j++)
{
switch (thrdentry[j].ti_state)
pse.stack_size = 0;
ps_list_add (cmdline, cargs, &pse);
- }
+ } /* for (i = 0 .. nprocs) */
+
if (nprocs < MAXPROCENTRY)
break;
- }
+ } /* while (getprocs64() > 0) */
ps_submit_state ("running", running);
ps_submit_state ("sleeping", sleeping);
ps_submit_state ("zombies", zombies);