summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linprocfs/linprocfs.c2
-rw-r--r--sys/compat/linprocfs/linprocfs_misc.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index d4cd0c2..7b73d2d 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -422,10 +422,12 @@ linprocfs_doprocstatus(curp, p, pfs, uio)
ps = psbuf;
+ mtx_enter(&sched_lock, MTX_SPIN);
if (p->p_stat > sizeof state_str / sizeof *state_str)
state = state_str[0];
else
state = state_str[(int)p->p_stat];
+ mtx_exit(&sched_lock, MTX_SPIN);
#define PS_ADD ps += sprintf
PS_ADD(ps, "Name:\t%s\n", p->p_comm); /* XXX escape */
diff --git a/sys/compat/linprocfs/linprocfs_misc.c b/sys/compat/linprocfs/linprocfs_misc.c
index d4cd0c2..7b73d2d 100644
--- a/sys/compat/linprocfs/linprocfs_misc.c
+++ b/sys/compat/linprocfs/linprocfs_misc.c
@@ -422,10 +422,12 @@ linprocfs_doprocstatus(curp, p, pfs, uio)
ps = psbuf;
+ mtx_enter(&sched_lock, MTX_SPIN);
if (p->p_stat > sizeof state_str / sizeof *state_str)
state = state_str[0];
else
state = state_str[(int)p->p_stat];
+ mtx_exit(&sched_lock, MTX_SPIN);
#define PS_ADD ps += sprintf
PS_ADD(ps, "Name:\t%s\n", p->p_comm); /* XXX escape */
OpenPOWER on IntegriCloud