summaryrefslogtreecommitdiffstats
path: root/sys/miscfs/procfs/procfs_status.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/miscfs/procfs/procfs_status.c')
-rw-r--r--sys/miscfs/procfs/procfs_status.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/miscfs/procfs/procfs_status.c b/sys/miscfs/procfs/procfs_status.c
index 0a6fbb47fff..0a629e92a04 100644
--- a/sys/miscfs/procfs/procfs_status.c
+++ b/sys/miscfs/procfs/procfs_status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: procfs_status.c,v 1.10 2007/06/18 08:30:07 jasper Exp $ */
+/* $OpenBSD: procfs_status.c,v 1.11 2010/07/26 01:56:27 guenther Exp $ */
/* $NetBSD: procfs_status.c,v 1.11 1996/03/16 23:52:50 christos Exp $ */
/*
@@ -64,6 +64,7 @@ int procfs_stat_gen(struct proc *, char *s, int);
int
procfs_stat_gen(struct proc *p, char *s, int l)
{
+ struct process *pr = p->p_p;
struct session *sess;
struct tty *tp;
struct ucred *cr;
@@ -72,11 +73,11 @@ procfs_stat_gen(struct proc *p, char *s, int l)
char ps[256], *sep;
int i, n;
- pid = p->p_pid;
- ppid = p->p_pptr ? p->p_pptr->p_pid : 0;
- pgid = p->p_pgrp->pg_id;
- sess = p->p_pgrp->pg_session;
- sid = sess->s_leader ? sess->s_leader->p_pid : 0;
+ pid = pr->ps_pid;
+ ppid = pr->ps_pptr ? pr->ps_pptr->ps_pid : 0;
+ pgid = pr->ps_pgrp->pg_id;
+ sess = pr->ps_pgrp->pg_session;
+ sid = sess->s_leader ? sess->s_leader->ps_pid : 0;
n = 0;
if (s)
@@ -90,7 +91,7 @@ procfs_stat_gen(struct proc *p, char *s, int l)
pid, ppid, pgid, sid);
COUNTORCAT(s, l, ps, n);
- if ((p->p_flag&P_CONTROLT) && (tp = sess->s_ttyp))
+ if ((pr->ps_flags & PS_CONTROLT) && (tp = sess->s_ttyp))
snprintf(ps, sizeof(ps), "%d,%d ",
major(tp->t_dev), minor(tp->t_dev));
else
@@ -105,7 +106,7 @@ procfs_stat_gen(struct proc *p, char *s, int l)
COUNTORCAT(s, l, ps, n);
}
- if (SESS_LEADER(p)) {
+ if (SESS_LEADER(pr)) {
snprintf(ps, sizeof(ps), "%ssldr", sep);
sep = ",";
COUNTORCAT(s, l, ps, n);