summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorad <ad@NetBSD.org>2007-02-09 22:08:48 +0000
committerad <ad@NetBSD.org>2007-02-09 22:08:48 +0000
commit401499f30e43e9ebf55c065c70fbb3c8d2ea39cd (patch)
tree562788dc7eb8b22c4887be2afd92ceb8ac0ebfc9
parentb07ec3fc388a5aeae51e8871aa89eefea3ce1e53 (diff)
Sync with kernel changes introduced by merging the newlock2 branch.
-rw-r--r--bin/ps/print.c24
-rw-r--r--bin/ps/ps.c8
-rwxr-xr-xlib/libc/sys/makelintstub3
-rw-r--r--lib/libkvm/kvm_proc.c44
-rw-r--r--lib/libpthread/Makefile4
-rw-r--r--lib/libpthread_dbg/Makefile4
-rw-r--r--regress/include/okheaders/symbolcheck.c5
-rw-r--r--usr.bin/kdump/kdump.c48
-rw-r--r--usr.bin/ktrace/ktrace.h4
-rw-r--r--usr.bin/ktrace/subr.c7
-rw-r--r--usr.bin/pkill/pkill.c6
-rw-r--r--usr.bin/systat/ps.c18
-rw-r--r--usr.bin/top/machine/m_netbsd15.c8
13 files changed, 58 insertions, 125 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index dc812f797b9..10f00a9b476 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -1,4 +1,4 @@
-/* $NetBSD: print.c,v 1.96 2006/10/29 22:32:53 christos Exp $ */
+/* $NetBSD: print.c,v 1.97 2007/02/09 22:08:48 ad Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
#if 0
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#else
-__RCSID("$NetBSD: print.c,v 1.96 2006/10/29 22:32:53 christos Exp $");
+__RCSID("$NetBSD: print.c,v 1.97 2007/02/09 22:08:48 ad Exp $");
#endif
#endif /* not lint */
@@ -347,7 +347,7 @@ command(void *arg, VARENT *ve, int mode)
* are system commands. Otherwise they are
* printed within parentheses.
*/
- if (ki->p_flag & P_SYSTEM) {
+ if (ki->p_flag & KP_SYSTEM) {
fmt_putc('[', &left);
fmt_puts(name, &left);
fmt_putc(']', &left);
@@ -512,7 +512,6 @@ state(void *arg, VARENT *ve, int mode)
break;
case LSZOMB:
- case LSDEAD:
*cp = 'Z';
is_zombie = 1;
break;
@@ -532,26 +531,26 @@ state(void *arg, VARENT *ve, int mode)
*cp++ = '<';
else if (k->p_nice > NZERO)
*cp++ = 'N';
- if (flag & P_TRACED)
+ if (flag & KP_TRACED)
*cp++ = 'X';
- if (flag & P_SYSTRACE)
+ if (flag & KP_SYSTRACE)
*cp++ = 'x';
- if (flag & P_WEXIT && !is_zombie)
+ if (flag & KP_WEXIT && !is_zombie)
*cp++ = 'E';
- if (flag & P_PPWAIT)
+ if (flag & KP_PPWAIT)
*cp++ = 'V';
- if (flag & P_SYSTEM)
+ if (flag & KP_SYSTEM)
*cp++ = 'K';
/* system process might have this too, don't need to double up */
else if (k->p_holdcnt)
*cp++ = 'L';
if (k->p_eflag & EPROC_SLEADER)
*cp++ = 's';
- if (flag & P_SA)
+ if (flag & KP_SA)
*cp++ = 'a';
else if (k->p_nlwps > 1)
*cp++ = 'l';
- if ((flag & P_CONTROLT) && k->p__pgid == k->p_tpgid)
+ if ((flag & KP_CONTROLT) && k->p__pgid == k->p_tpgid)
*cp++ = '+';
*cp = '\0';
strprintorsetwidth(v, buf, mode);
@@ -592,7 +591,6 @@ lstate(void *arg, VARENT *ve, int mode)
break;
case LSZOMB:
- case LSDEAD:
*cp = 'Z';
is_zombie = 1;
break;
@@ -610,7 +608,7 @@ lstate(void *arg, VARENT *ve, int mode)
*cp++ = 'W';
if (k->l_holdcnt)
*cp++ = 'L';
- if (flag & L_DETACHED)
+ if (flag & KL_DETACHED)
*cp++ = '-';
*cp = '\0';
strprintorsetwidth(v, buf, mode);
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index 1623bd95d6a..bbb37c04123 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ps.c,v 1.61 2006/10/02 17:54:35 apb Exp $ */
+/* $NetBSD: ps.c,v 1.62 2007/02/09 22:08:48 ad Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 1993, 1994\n\
#if 0
static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94";
#else
-__RCSID("$NetBSD: ps.c,v 1.61 2006/10/02 17:54:35 apb Exp $");
+__RCSID("$NetBSD: ps.c,v 1.62 2007/02/09 22:08:48 ad Exp $");
#endif
#endif /* not lint */
@@ -411,7 +411,7 @@ main(int argc, char *argv[])
struct kinfo_proc2 *ki = &kinfo[i];
if (xflg == 0 && (ki->p_tdev == NODEV ||
- (ki->p_flag & P_CONTROLT) == 0))
+ (ki->p_flag & KP_CONTROLT) == 0))
continue;
kl = kvm_getlwps(kd, ki->p_pid, ki->p_paddr,
@@ -447,7 +447,7 @@ main(int argc, char *argv[])
struct kinfo_proc2 *ki = &kinfo[i];
if (xflg == 0 && (ki->p_tdev == NODEV ||
- (ki->p_flag & P_CONTROLT ) == 0))
+ (ki->p_flag & KP_CONTROLT ) == 0))
continue;
kl = kvm_getlwps(kd, ki->p_pid, (u_long)ki->p_paddr,
sizeof(struct kinfo_lwp), &nlwps);
diff --git a/lib/libc/sys/makelintstub b/lib/libc/sys/makelintstub
index f7b5258a1ff..8acd512f353 100755
--- a/lib/libc/sys/makelintstub
+++ b/lib/libc/sys/makelintstub
@@ -1,5 +1,5 @@
#!/bin/sh -
-# $NetBSD: makelintstub,v 1.17 2006/06/18 14:28:12 christos Exp $
+# $NetBSD: makelintstub,v 1.18 2007/02/09 22:08:48 ad Exp $
#
# Copyright (c) 1996, 1997 Christopher G. Demetriou
# All rights reserved.
@@ -56,7 +56,6 @@ header()
#include <sys/time.h>
#include <sys/mount.h>
#include <sys/stat.h>
- #include <sys/sa.h>
#include <ufs/ufs/dinode.h>
#include <ufs/lfs/lfs.h>
#include <sys/resource.h>
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c
index d0a439fea6f..7fea6382064 100644
--- a/lib/libkvm/kvm_proc.c
+++ b/lib/libkvm/kvm_proc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: kvm_proc.c,v 1.65 2007/02/06 21:21:51 elad Exp $ */
+/* $NetBSD: kvm_proc.c,v 1.66 2007/02/09 22:08:48 ad Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
#if 0
static char sccsid[] = "@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93";
#else
-__RCSID("$NetBSD: kvm_proc.c,v 1.65 2007/02/06 21:21:51 elad Exp $");
+__RCSID("$NetBSD: kvm_proc.c,v 1.66 2007/02/09 22:08:48 ad Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -85,6 +85,8 @@ __RCSID("$NetBSD: kvm_proc.c,v 1.65 2007/02/06 21:21:51 elad Exp $");
* most other applications are interested only in open/close/read/nlist).
*/
+#define _KAUTH_PRIVATE
+
#include <sys/param.h>
#include <sys/user.h>
#include <sys/lwp.h>
@@ -94,6 +96,8 @@ __RCSID("$NetBSD: kvm_proc.c,v 1.65 2007/02/06 21:21:51 elad Exp $");
#include <sys/ioctl.h>
#include <sys/tty.h>
#include <sys/resourcevar.h>
+#include <sys/kauth_impl.h>
+
#include <errno.h>
#include <stdlib.h>
#include <stddef.h>
@@ -150,27 +154,6 @@ struct miniproc {
(p)->p_vmspace = (void *)(long)(kp)->p_vmspace; \
} while (/*CONSTCOND*/0);
-/*
- * NetBSD uses kauth(9) to manage credentials, which are stored in kauth_cred_t,
- * a kernel-only opaque type. This is an embedded version which is *INTERNAL* to
- * kvm(3) so dumps can be read properly.
- *
- * Whenever NetBSD starts exporting credentials to userland consistently (using
- * 'struct uucred', or something) this will have to be updated again.
- */
-struct kvm_kauth_cred {
- struct simplelock cr_lock; /* lock on cr_refcnt */
- u_int cr_refcnt; /* reference count */
- uid_t cr_uid; /* user id */
- uid_t cr_euid; /* effective user id */
- uid_t cr_svuid; /* saved effective user id */
- gid_t cr_gid; /* group id */
- gid_t cr_egid; /* effective group id */
- gid_t cr_svgid; /* saved effective group id */
- u_int cr_ngroups; /* number of groups */
- gid_t cr_groups[NGROUPS]; /* group memberships */
-};
-
#define KREAD(kd, addr, obj) \
(kvm_read(kd, addr, (obj), sizeof(*obj)) != sizeof(*obj))
@@ -305,7 +288,7 @@ _kvm_uread(kd, p, va, cnt)
static int
_kvm_convertcred(kvm_t *kd, u_long cred, struct eproc *eproc)
{
- struct kvm_kauth_cred kauthcred;
+ struct kauth_cred kauthcred;
struct pcred *pc = &eproc->e_pcred;
struct ucred *uc = &eproc->e_ucred;
@@ -407,7 +390,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
pgrp.pg_session);
return (-1);
}
- if ((proc.p_flag & P_CONTROLT) && sess.s_ttyp != NULL) {
+ if ((proc.p_lflag & PL_CONTROLT) && sess.s_ttyp != NULL) {
if (KREAD(kd, (u_long)sess.s_ttyp, &tty)) {
_kvm_err(kd, kd->program,
"can't read tty at %p", sess.s_ttyp);
@@ -457,7 +440,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
break;
case KERN_PROC_TTY:
- if ((proc.p_flag & P_CONTROLT) == 0 ||
+ if ((proc.p_lflag & PL_CONTROLT) == 0 ||
eproc.e_tdev != (dev_t)arg)
continue;
break;
@@ -610,8 +593,8 @@ again:
kp2p->p_tsess = PTRTOUINT64(kp->kp_eproc.e_tsess);
kp2p->p_estcpu = kp->kp_proc.p_estcpu;
- kp2p->p_rtime_sec = kp->kp_proc.p_estcpu;
- kp2p->p_rtime_usec = kp->kp_proc.p_estcpu;
+ kp2p->p_rtime_sec = kp->kp_proc.p_rtime.tv_sec;
+ kp2p->p_rtime_usec = kp->kp_proc.p_rtime.tv_usec;
kp2p->p_cpticks = kp->kp_proc.p_cpticks;
kp2p->p_pctcpu = kp->kp_proc.p_pctcpu;
kp2p->p_swtime = kl[0].l_swtime;
@@ -632,10 +615,9 @@ again:
kp2p->p_holdcnt = kl[0].l_holdcnt;
memcpy(&kp2p->p_siglist,
- &kp->kp_proc.p_sigctx.ps_siglist,
+ &kp->kp_proc.p_sigpend.sp_set,
sizeof(ki_sigset_t));
- memcpy(&kp2p->p_sigmask,
- &kp->kp_proc.p_sigctx.ps_sigmask,
+ memset(&kp2p->p_sigmask, 0,
sizeof(ki_sigset_t));
memcpy(&kp2p->p_sigignore,
&kp->kp_proc.p_sigctx.ps_sigignore,
diff --git a/lib/libpthread/Makefile b/lib/libpthread/Makefile
index c7f9e572e00..8c7642187d0 100644
--- a/lib/libpthread/Makefile
+++ b/lib/libpthread/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.38 2007/01/20 04:56:25 christos Exp $
+# $NetBSD: Makefile,v 1.39 2007/02/09 22:08:48 ad Exp $
#
-PTHREAD_SA=1
+#PTHREAD_SA=1
WARNS= 4
# Define PT_FIXEDSTACKSIZE_LG to set a fixed stacksize
diff --git a/lib/libpthread_dbg/Makefile b/lib/libpthread_dbg/Makefile
index 744bdfdcd53..f422a755d45 100644
--- a/lib/libpthread_dbg/Makefile
+++ b/lib/libpthread_dbg/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2006/12/24 03:54:43 christos Exp $
+# $NetBSD: Makefile,v 1.6 2007/02/09 22:09:32 ad Exp $
#
WARNS= 2
@@ -9,7 +9,7 @@ LIBPDIR= ${.CURDIR}/../libpthread
# Define PT_FIXEDSTACKSIZE_LG to set a fixed stacksize (same as libpthread)
#CPPFLAGS+=-DPT_FIXEDSTACKSIZE_LG=18
-CPPFLAGS+= -DPTHREAD_SA
+#CPPFLAGS+= -DPTHREAD_SA
.if exists(${LIBPDIR}/arch/${MACHINE_ARCH})
ARCHSUBDIR= ${MACHINE_ARCH}
diff --git a/regress/include/okheaders/symbolcheck.c b/regress/include/okheaders/symbolcheck.c
index 631441c4b52..e720ebbe1f2 100644
--- a/regress/include/okheaders/symbolcheck.c
+++ b/regress/include/okheaders/symbolcheck.c
@@ -22,6 +22,7 @@
#endif
#include <sys/cdio.h>
#include <sys/chio.h>
+#include <sys/condvar.h>
#include <sys/conf.h>
#include <sys/core.h>
#include <sys/device.h>
@@ -88,6 +89,7 @@
#include <sys/mount.h>
#include <sys/msg.h>
#include <sys/msgbuf.h>
+#include <sys/mutex.h>
#include <sys/mtio.h>
#include <sys/namei.h>
#include <sys/null.h>
@@ -108,7 +110,7 @@
#include <sys/resource.h>
#include <sys/resourcevar.h>
#include <sys/rnd.h>
-#include <sys/sa.h>
+#include <sys/rwlock.h>
#include <sys/scanio.h>
#include <sys/sched.h>
#include <sys/scsiio.h>
@@ -297,7 +299,6 @@
/* without this rmt.h re-defines ioctl which is also defined in soundcard.h */
#define __RMTLIB_PRIVATE
#include <rmt.h>
-#include <sa.h>
#include <sched.h>
#include <search.h>
#include <semaphore.h>
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index bc6b565fc0d..6fbba977448 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -1,4 +1,4 @@
-/* $NetBSD: kdump.c,v 1.88 2007/01/28 21:29:59 chs Exp $ */
+/* $NetBSD: kdump.c,v 1.89 2007/02/09 22:08:48 ad Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\n\
#if 0
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: kdump.c,v 1.88 2007/01/28 21:29:59 chs Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.89 2007/02/09 22:08:48 ad Exp $");
#endif
#endif /* not lint */
@@ -52,7 +52,6 @@ __RCSID("$NetBSD: kdump.c,v 1.88 2007/01/28 21:29:59 chs Exp $");
#include <sys/ktrace.h>
#include <sys/ioctl.h>
#include <sys/ptrace.h>
-#include <sys/sa.h>
#include <ctype.h>
#include <err.h>
@@ -116,7 +115,6 @@ static void ktrcsw(struct ktr_csw *);
static void ktruser(struct ktr_user *, int);
static void ktrmmsg(struct ktr_mmsg *, int);
static void ktrmool(struct ktr_mool *, int);
-static void ktrsaupcall(const struct ktr_saupcall *, int);
static void ktrmib(int *, int);
static void usage(void) __attribute__((__noreturn__));
static void eprint(int);
@@ -277,9 +275,6 @@ main(int argc, char **argv)
case KTR_EXEC_ENV:
visdump_buf(m, ktrlen, col);
break;
- case KTR_SAUPCALL:
- ktrsaupcall(m, ktrlen);
- break;
case KTR_MIB:
ktrmib(m, ktrlen);
break;
@@ -974,45 +969,6 @@ ktrmmsg(struct ktr_mmsg *mmsg, int len)
}
static void
-ktr_saprint(const struct ktr_saupcall *sau, int off, int len)
-{
- const struct sa_t * sa = (const struct sa_t *)(const void *)&sau[1];
- int i;
- for (i = off; i < off + len; i++) {
- printf("<ctx=%p, id=%d, cpu=%d>%s",
- sa[i].sa_context, sa[i].sa_id, sa[i].sa_cpu,
- i == off + len - 1 ? "" : ", ");
- }
-}
-
-static void
-ktrsaupcall(const struct ktr_saupcall *sau, int len)
-{
- char tbuf[64];
- const char *type;
- static const char *const sastrings[] = { SA_UPCALL_STRINGS };
-
- if (sau->ktr_type >= 0 && sau->ktr_type < SA_UPCALL_NUPCALLS)
- type = sastrings[sau->ktr_type];
- else {
- (void)snprintf(tbuf, sizeof(tbuf), "*%d*", sau->ktr_type);
- type = tbuf;
- }
- printf("%s", type);
- if (sau->ktr_nevent) {
- printf(", event=[");
- ktr_saprint(sau, 1, sau->ktr_nevent);
- printf("]");
- }
- if (sau->ktr_nint) {
- printf(", intr=[");
- ktr_saprint(sau, 1 + sau->ktr_nevent, sau->ktr_nint);
- printf("]");
- }
- printf("\n");
-}
-
-static void
ktrmool(struct ktr_mool *mool, int len)
{
size_t size = mool->size;
diff --git a/usr.bin/ktrace/ktrace.h b/usr.bin/ktrace/ktrace.h
index 85f19ec9c92..8c402019dfa 100644
--- a/usr.bin/ktrace/ktrace.h
+++ b/usr.bin/ktrace/ktrace.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ktrace.h,v 1.17 2006/02/07 06:39:47 skrll Exp $ */
+/* $NetBSD: ktrace.h,v 1.18 2007/02/09 22:08:49 ad Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -33,7 +33,7 @@
#define DEF_POINTS (KTRFAC_SYSCALL | KTRFAC_SYSRET | KTRFAC_NAMEI | \
KTRFAC_GENIO | KTRFAC_PSIG | KTRFAC_EMUL | KTRFAC_USER | \
- KTRFAC_MMSG | KTRFAC_MOOL | KTRFAC_SAUPCALL)
+ KTRFAC_MMSG | KTRFAC_MOOL)
#define ALL_POINTS KTRFAC_MASK
diff --git a/usr.bin/ktrace/subr.c b/usr.bin/ktrace/subr.c
index b8a279d2d54..098e5e9a1e0 100644
--- a/usr.bin/ktrace/subr.c
+++ b/usr.bin/ktrace/subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: subr.c,v 1.15 2006/09/23 22:01:04 manu Exp $ */
+/* $NetBSD: subr.c,v 1.16 2007/02/09 22:08:49 ad Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)subr.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: subr.c,v 1.15 2006/09/23 22:01:04 manu Exp $");
+__RCSID("$NetBSD: subr.c,v 1.16 2007/02/09 22:08:49 ad Exp $");
#endif
#endif /* not lint */
@@ -91,9 +91,6 @@ getpoints(int facs, char *s)
case 'u':
fac = KTRFAC_USER;
break;
- case 'U':
- fac = KTRFAC_SAUPCALL;
- break;
case 'S':
fac = KTRFAC_MIB;
break;
diff --git a/usr.bin/pkill/pkill.c b/usr.bin/pkill/pkill.c
index 67a72b8a131..0c2de7ed187 100644
--- a/usr.bin/pkill/pkill.c
+++ b/usr.bin/pkill/pkill.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pkill.c,v 1.17 2006/02/25 01:13:55 wiz Exp $ */
+/* $NetBSD: pkill.c,v 1.18 2007/02/09 22:08:49 ad Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: pkill.c,v 1.17 2006/02/25 01:13:55 wiz Exp $");
+__RCSID("$NetBSD: pkill.c,v 1.18 2007/02/09 22:08:49 ad Exp $");
#endif /* !lint */
#include <sys/types.h>
@@ -345,7 +345,7 @@ main(int argc, char **argv)
SLIST_FOREACH(li, &tdevlist, li_chain) {
if (li->li_number == -1 &&
- (kp->p_flag & P_CONTROLT) == 0)
+ (kp->p_flag & KP_CONTROLT) == 0)
break;
if (kp->p_tdev == (uid_t)li->li_number)
break;
diff --git a/usr.bin/systat/ps.c b/usr.bin/systat/ps.c
index bf9ae3ccc60..b10eace0b29 100644
--- a/usr.bin/systat/ps.c
+++ b/usr.bin/systat/ps.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ps.c,v 1.28 2006/02/13 16:01:58 kleink Exp $ */
+/* $NetBSD: ps.c,v 1.29 2007/02/09 22:08:49 ad Exp $ */
/*-
* Copyright (c) 1999
@@ -45,7 +45,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: ps.c,v 1.28 2006/02/13 16:01:58 kleink Exp $");
+__RCSID("$NetBSD: ps.c,v 1.29 2007/02/09 22:08:49 ad Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -200,19 +200,19 @@ state2str(struct kinfo_proc2 *kp)
*cp++ = '<';
else if (kp->p_nice > NZERO)
*cp++ = 'N';
- if (flag & P_TRACED)
+ if (flag & KP_TRACED)
*cp++ = 'X';
- if (flag & P_WEXIT &&
+ if (flag & KP_WEXIT &&
/* XXX - I don't like this */
- (kp->p_stat == LSZOMB || kp->p_stat == LSDEAD) == 0)
+ (kp->p_stat != LSZOMB))
*cp++ = 'E';
- if (flag & P_PPWAIT)
+ if (flag & KP_PPWAIT)
*cp++ = 'V';
- if ((flag & P_SYSTEM) || kp->p_holdcnt)
+ if ((flag & KP_SYSTEM) || kp->p_holdcnt)
*cp++ = 'L';
if (kp->p_eflag & EPROC_SLEADER)
*cp++ = 's';
- if ((flag & P_CONTROLT) && kp->p__pgid == kp->p_tpgid)
+ if ((flag & KP_CONTROLT) && kp->p__pgid == kp->p_tpgid)
*cp++ = '+';
*cp = '\0';
snprintf(statestr, sizeof(statestr), "%-s", buf);
@@ -286,7 +286,7 @@ comm2str(struct kinfo_proc2 *kp)
* square brackets if they are system commands. Otherwise
* they are printed within parentheses.
*/
- if (kp->p_flag & P_SYSTEM)
+ if (kp->p_flag & KP_SYSTEM)
fmt = "[%s]";
else
fmt = "(%s)";
diff --git a/usr.bin/top/machine/m_netbsd15.c b/usr.bin/top/machine/m_netbsd15.c
index e389cc5d862..860f763fa82 100644
--- a/usr.bin/top/machine/m_netbsd15.c
+++ b/usr.bin/top/machine/m_netbsd15.c
@@ -1,4 +1,4 @@
-/* $NetBSD: m_netbsd15.c,v 1.25 2006/02/16 20:50:57 christos Exp $ */
+/* $NetBSD: m_netbsd15.c,v 1.26 2007/02/09 22:08:49 ad Exp $ */
/*
* top - a top users display for Unix
@@ -36,12 +36,12 @@
* Tomas Svensson <ts@unix1.net>
*
*
- * $Id: m_netbsd15.c,v 1.25 2006/02/16 20:50:57 christos Exp $
+ * $Id: m_netbsd15.c,v 1.26 2007/02/09 22:08:49 ad Exp $
*/
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: m_netbsd15.c,v 1.25 2006/02/16 20:50:57 christos Exp $");
+__RCSID("$NetBSD: m_netbsd15.c,v 1.26 2007/02/09 22:08:49 ad Exp $");
#endif
#include <sys/param.h>
@@ -502,7 +502,7 @@ get_process_info(si, sel, compare)
if (pp->p_stat != 0 && (show_system || ((pp->p_flag & P_SYSTEM) == 0))) {
total_procs++;
process_states[(unsigned char) pp->p_stat]++;
- if (pp->p_stat != LSZOMB && pp->p_stat != LSDEAD &&
+ if (pp->p_stat != LSZOMB &&
(show_idle || (pp->p_pctcpu != 0) ||
(pp->p_stat == LSRUN || pp->p_stat == LSONPROC)) &&
(!show_uid || pp->p_ruid == (uid_t)sel->uid)) {