summaryrefslogtreecommitdiffstats
path: root/sys/fs/procfs/procfs_vnops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/procfs/procfs_vnops.c')
-rw-r--r--sys/fs/procfs/procfs_vnops.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c
index e37f3c2..05ad13a 100644
--- a/sys/fs/procfs/procfs_vnops.c
+++ b/sys/fs/procfs/procfs_vnops.c
@@ -820,8 +820,10 @@ procfs_readdir(ap)
int doingzomb = 0;
#endif
int pcnt = 0;
- struct proc *p = allproc.lh_first;
+ struct proc *p;
+ ALLPROC_LOCK(AP_SHARED);
+ p = allproc.lh_first;
for (; p && uio->uio_resid >= delen; i++, pcnt++) {
bzero((char *) dp, delen);
dp->d_reclen = delen;
@@ -878,6 +880,7 @@ procfs_readdir(ap)
}
#endif
+ ALLPROC_LOCK(AP_RELEASE);
break;
}
OpenPOWER on IntegriCloud