Further changes to use compat process flags mapped by sysctl. To be
revisited soon.
This commit is contained in:
parent
39aa6289a6
commit
8966ad6a93
@ -1,7 +1,7 @@
|
||||
/* $NetBSD: print.c,v 1.97 2007/02/09 22:08:48 ad Exp $ */
|
||||
/* $NetBSD: print.c,v 1.98 2007/02/10 18:20:12 ad Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
@ -70,7 +70,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: print.c,v 1.97 2007/02/09 22:08:48 ad Exp $");
|
||||
__RCSID("$NetBSD: print.c,v 1.98 2007/02/10 18:20:12 ad Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -499,7 +499,7 @@ state(void *arg, VARENT *ve, int mode)
|
||||
break;
|
||||
|
||||
case LSSLEEP:
|
||||
if (flag & L_SINTR) /* interruptable (long) */
|
||||
if (flag & KP_SINTR) /* interruptable (long) */
|
||||
*cp = k->p_slptime >= maxslp ? 'I' : 'S';
|
||||
else
|
||||
*cp = 'D';
|
||||
@ -524,7 +524,7 @@ state(void *arg, VARENT *ve, int mode)
|
||||
*cp = '?';
|
||||
}
|
||||
cp++;
|
||||
if (flag & L_INMEM) {
|
||||
if (flag & KP_INMEM) {
|
||||
} else
|
||||
*cp++ = 'W';
|
||||
if (k->p_nice < NZERO)
|
||||
@ -1078,7 +1078,7 @@ getpcpu(k)
|
||||
#define fxtofl(fixpt) ((double)(fixpt) / fscale)
|
||||
|
||||
/* XXX - I don't like this */
|
||||
if (k->p_swtime == 0 || (k->p_flag & L_INMEM) == 0 ||
|
||||
if (k->p_swtime == 0 || (k->p_flag & KP_INMEM) == 0 ||
|
||||
k->p_stat == SZOMB)
|
||||
return (0.0);
|
||||
if (rawcpu)
|
||||
@ -1111,7 +1111,7 @@ getpmem(k)
|
||||
if (failure)
|
||||
return (0.0);
|
||||
|
||||
if ((k->p_flag & L_INMEM) == 0)
|
||||
if ((k->p_flag & KP_INMEM) == 0)
|
||||
return (0.0);
|
||||
/* XXX want pmap ptpages, segtab, etc. (per architecture) */
|
||||
szptudot = uspace/getpagesize();
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* $NetBSD: pkill.c,v 1.18 2007/02/09 22:08:49 ad Exp $ */
|
||||
/* $NetBSD: pkill.c,v 1.19 2007/02/10 18:20:12 ad Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: pkill.c,v 1.18 2007/02/09 22:08:49 ad Exp $");
|
||||
__RCSID("$NetBSD: pkill.c,v 1.19 2007/02/10 18:20:12 ad Exp $");
|
||||
#endif /* !lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -261,7 +261,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
for (i = 0, kp = plist; i < nproc; i++, kp++) {
|
||||
if ((kp->p_flag & P_SYSTEM) != 0 || kp->p_pid == mypid)
|
||||
if ((kp->p_flag & KP_SYSTEM) != 0 || kp->p_pid == mypid)
|
||||
continue;
|
||||
|
||||
if (matchargs) {
|
||||
@ -300,7 +300,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
for (i = 0, kp = plist; i < nproc; i++, kp++) {
|
||||
if ((kp->p_flag & P_SYSTEM) != 0)
|
||||
if ((kp->p_flag & KP_SYSTEM) != 0)
|
||||
continue;
|
||||
|
||||
SLIST_FOREACH(li, &ruidlist, li_chain)
|
||||
@ -402,7 +402,7 @@ main(int argc, char **argv)
|
||||
} else if (!inverse)
|
||||
continue;
|
||||
|
||||
if ((kp->p_flag & P_SYSTEM) != 0)
|
||||
if ((kp->p_flag & KP_SYSTEM) != 0)
|
||||
continue;
|
||||
|
||||
rv |= (*action)(kp);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: m_netbsd15.c,v 1.26 2007/02/09 22:08:49 ad Exp $ */
|
||||
/* $NetBSD: m_netbsd15.c,v 1.27 2007/02/10 18:20:12 ad Exp $ */
|
||||
|
||||
/*
|
||||
* top - a top users display for Unix
|
||||
@ -36,12 +36,12 @@
|
||||
* Tomas Svensson <ts@unix1.net>
|
||||
*
|
||||
*
|
||||
* $Id: m_netbsd15.c,v 1.26 2007/02/09 22:08:49 ad Exp $
|
||||
* $Id: m_netbsd15.c,v 1.27 2007/02/10 18:20:12 ad Exp $
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: m_netbsd15.c,v 1.26 2007/02/09 22:08:49 ad Exp $");
|
||||
__RCSID("$NetBSD: m_netbsd15.c,v 1.27 2007/02/10 18:20:12 ad Exp $");
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -496,10 +496,10 @@ get_process_info(si, sel, compare)
|
||||
/*
|
||||
* Place pointers to each valid proc structure in pref[].
|
||||
* Process slots that are actually in use have a non-zero
|
||||
* status field. Processes with P_SYSTEM set are system
|
||||
* status field. Processes with KP_SYSTEM set are system
|
||||
* processes---these get ignored unless show_sysprocs is set.
|
||||
*/
|
||||
if (pp->p_stat != 0 && (show_system || ((pp->p_flag & P_SYSTEM) == 0))) {
|
||||
if (pp->p_stat != 0 && (show_system || ((pp->p_flag & KP_SYSTEM) == 0))) {
|
||||
total_procs++;
|
||||
process_states[(unsigned char) pp->p_stat]++;
|
||||
if (pp->p_stat != LSZOMB &&
|
||||
@ -552,9 +552,9 @@ format_next_process(handle, get_userid)
|
||||
hp->remaining--;
|
||||
|
||||
/* get the process's user struct and set cputime */
|
||||
if ((pp->p_flag & L_INMEM) == 0)
|
||||
if ((pp->p_flag & KP_INMEM) == 0)
|
||||
pretty = "<>";
|
||||
else if ((pp->p_flag & P_SYSTEM) != 0)
|
||||
else if ((pp->p_flag & KP_SYSTEM) != 0)
|
||||
pretty = "[]";
|
||||
|
||||
if (pretty[0] != '\0') {
|
||||
|
Loading…
Reference in New Issue
Block a user