From 6d3e7b9b0bf8949d8c287753881ef8ebbb2f608a Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 24 Jan 2001 12:49:52 +0000 Subject: [PATCH] Add a new item to kinfo_proc: ki_sflag to mirror p_sflag. --- lib/libkvm/kvm_proc.c | 3 ++- sys/kern/kern_proc.c | 1 + sys/sys/user.h | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index f503489896a5..8c2cf9c8952b 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -182,7 +182,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt) kp->ki_sigignore = procsig.ps_sigignore; kp->ki_sigcatch = procsig.ps_sigcatch; } - if ((proc.p_flag & P_INMEM) && proc.p_stats != NULL) { + if ((proc.p_sflag & PS_INMEM) && proc.p_stats != NULL) { if (KREAD(kd, (u_long)proc.p_stats, &pstats)) { _kvm_err(kd, kd->program, "can't read stats at %x", proc.p_stats); @@ -311,6 +311,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt) kp->ki_slptime = proc.p_slptime; kp->ki_swtime = proc.p_swtime; kp->ki_flag = proc.p_flag; + kp->ki_sflag = proc.p_sflag; kp->ki_wchan = proc.p_wchan; kp->ki_traceflag = proc.p_traceflag; kp->ki_priority = proc.p_priority; diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index d517863230b9..f5b35c184142 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -432,6 +432,7 @@ fill_kinfo_proc(p, kp) kp->ki_mtxname[MTXNAMELEN] = 0; } kp->ki_stat = p->p_stat; + kp->ki_sflag = p->p_sflag; kp->ki_pctcpu = p->p_pctcpu; kp->ki_estcpu = p->p_estcpu; kp->ki_slptime = p->p_slptime; diff --git a/sys/sys/user.h b/sys/sys/user.h index 55838398a8d8..0b31fcdc964b 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -143,7 +143,8 @@ struct kinfo_proc { char ki_sparestrings[102]; /* spare string space */ struct rtprio ki_rtprio; /* Realtime priority */ struct rusage ki_rusage; /* process rusage statistics */ - long ki_spare[25]; /* spare constants */ + long ki_sflag; /* PS_* flags */ + long ki_spare[24]; /* spare constants */ }; void fill_kinfo_proc __P((struct proc *, struct kinfo_proc *));