Use correct values for the `state' field.

1998-10-03  Martin Baulig  <martin@home-of-linux.org>

	* procstate.c (glibtop_get_procstate_s): Use correct values for
	the `state' field.

	* proclist.c (glibtop_get_proclist_p): Honor the GLIBTOP_EXCLUDE_IDLE
	and GLIBTOP_EXCLUDE_SYSTEM flags of the `which' parameter.
This commit is contained in:
Martin Baulig
1998-10-03 02:15:55 +00:00
committed by Martin Baulig
parent 0289863af0
commit a444c860d2
3 changed files with 42 additions and 9 deletions

View File

@@ -68,7 +68,26 @@ glibtop_get_proc_state_p (glibtop *server,
buf->uid = pinfo [0].kp_eproc.e_pcred.p_svuid;
buf->gid = pinfo [0].kp_eproc.e_pcred.p_svgid;
buf->state = pinfo [0].kp_proc.p_stat;
switch (pinfo [0].kp_proc.p_stat) {
case SIDL:
buf->state = 'I';
break;
case SRUN:
buf->state = 'R';
break;
case SSLEEP:
buf->state = 'S';
break;
case SSTOP:
buf->state = 'T';
break;
case SZOMB:
buf->state = 'Z';
break;
default:
buf->state = '?';
break;
}
/* Set the flags for the data we're about to return*/
buf->flags = _glibtop_sysdeps_proc_state;