summaryrefslogtreecommitdiffstats
path: root/lib/libkvm
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2009-06-07 21:35:11 +0000
committermillert <millert@openbsd.org>2009-06-07 21:35:11 +0000
commitc6fa9a043cb870efb80f9d06dc42d82850c34b91 (patch)
tree99eb2c4087240abb0ce8d462f500fd0e197b5869 /lib/libkvm
parentxfs -> nnpfs; ok jj (diff)
downloadwireguard-openbsd-c6fa9a043cb870efb80f9d06dc42d82850c34b91.tar.xz
wireguard-openbsd-c6fa9a043cb870efb80f9d06dc42d82850c34b91.zip
Define _KERNEL for the bare minimum. We can include sys/proc.h
normally as long as we define __need_process and use a local definition of struct proclist.
Diffstat (limited to 'lib/libkvm')
-rw-r--r--lib/libkvm/kvm_file2.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/libkvm/kvm_file2.c b/lib/libkvm/kvm_file2.c
index e72f8c6ac66..8d4b07bb23a 100644
--- a/lib/libkvm/kvm_file2.c
+++ b/lib/libkvm/kvm_file2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_file2.c,v 1.2 2009/06/07 10:44:00 millert Exp $ */
+/* $OpenBSD: kvm_file2.c,v 1.3 2009/06/07 21:35:11 millert Exp $ */
/*
* Copyright (c) 2009 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -46,7 +46,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: kvm_file2.c,v 1.2 2009/06/07 10:44:00 millert Exp $";
+static char *rcsid = "$OpenBSD: kvm_file2.c,v 1.3 2009/06/07 21:35:11 millert Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -56,14 +56,15 @@ static char *rcsid = "$OpenBSD: kvm_file2.c,v 1.2 2009/06/07 10:44:00 millert Ex
* most other applications are interested only in open/close/read/nlist).
*/
+#define __need_process
+
#include <sys/param.h>
-#define _KERNEL
+#include <sys/uio.h>
#include <sys/ucred.h>
+#include <sys/proc.h>
+#define _KERNEL
#include <sys/file.h>
#include <sys/mount.h>
-#include <sys/uio.h>
-#include <sys/selinfo.h>
-#include <sys/proc.h>
#include <dev/systrace.h>
#undef _KERNEL
#include <sys/vnode.h>
@@ -126,6 +127,8 @@ static int fill_file2(kvm_t *, struct kinfo_file2 *, struct file *,
struct vnode *, struct proc *, int);
static int filestat(kvm_t *, struct kinfo_file2 *, struct vnode *);
+LIST_HEAD(proclist, proc);
+
struct kinfo_file2 *
kvm_getfile2(kvm_t *kd, int op, int arg, size_t esize, int *cnt)
{