From cc970022c8e2ad312e68be806cb0071ca3d4c301 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 27 Aug 2003 03:21:50 +0000 Subject: [PATCH] Adjust our kvm based utilities to use the _KERNEL_STRUCTURES define instead of _KERNEL to access kernel header files. --- gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c | 4 +++- usr.bin/fstat/cd9660.c | 6 +++--- usr.bin/fstat/fstat.c | 6 +++--- usr.bin/fstat/msdosfs.c | 6 +++--- usr.bin/ipcs/ipcs.c | 5 +++-- usr.bin/kdump/kdump.c | 7 +++---- usr.bin/ktrace/subr.c | 4 +++- usr.bin/vmstat/vmstat.c | 11 ++++++++++- usr.sbin/ifmcstat/ifmcstat.c | 6 +++--- usr.sbin/pstat/pstat.c | 6 +++--- usr.sbin/route6d/route6d.c | 8 +++----- 11 files changed, 40 insertions(+), 29 deletions(-) diff --git a/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c b/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c index 6bfcb32f84..bc447ea2e5 100644 --- a/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c +++ b/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c @@ -18,7 +18,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* $FreeBSD: src/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c,v 1.17.4.3 2001/12/17 23:06:06 peter Exp $ */ -/* $DragonFly: src/gnu/usr.bin/binutils/gdb/i386/Attic/kvm-fbsd.c,v 1.3 2003/07/13 07:13:51 dillon Exp $ */ +/* $DragonFly: src/gnu/usr.bin/binutils/gdb/i386/Attic/kvm-fbsd.c,v 1.4 2003/08/27 03:21:48 dillon Exp $ */ + +#define _KERNEL_STRUCTURES #include "defs.h" diff --git a/usr.bin/fstat/cd9660.c b/usr.bin/fstat/cd9660.c index e6ce8e8251..52544a46eb 100644 --- a/usr.bin/fstat/cd9660.c +++ b/usr.bin/fstat/cd9660.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/fstat/cd9660.c,v 1.1.2.3 2001/11/21 10:49:37 dwmalone Exp $ - * $DragonFly: src/usr.bin/fstat/cd9660.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/fstat/cd9660.c,v 1.3 2003/08/27 03:21:49 dillon Exp $ */ /* @@ -43,13 +43,13 @@ * conflicts with UFS. */ +#define _KERNEL_STRUCTURES + #include #include #include #include -#define _KERNEL #include -#undef _KERNEL #include diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c index 81349ef70f..f9666d9041 100644 --- a/usr.bin/fstat/fstat.c +++ b/usr.bin/fstat/fstat.c @@ -33,9 +33,11 @@ * @(#) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)fstat.c 8.3 (Berkeley) 5/2/95 * $FreeBSD: src/usr.bin/fstat/fstat.c,v 1.21.2.7 2001/11/21 10:49:37 dwmalone Exp $ - * $DragonFly: src/usr.bin/fstat/fstat.c,v 1.4 2003/08/08 04:18:43 dillon Exp $ + * $DragonFly: src/usr.bin/fstat/fstat.c,v 1.5 2003/08/27 03:21:49 dillon Exp $ */ +#define _KERNEL_STRUCTURES + #include #include #include @@ -53,12 +55,10 @@ #include #include #include -#define _KERNEL #include #include #include #include -#undef _KERNEL #include #include #include diff --git a/usr.bin/fstat/msdosfs.c b/usr.bin/fstat/msdosfs.c index 5a53bf8fe2..d20fa558b0 100644 --- a/usr.bin/fstat/msdosfs.c +++ b/usr.bin/fstat/msdosfs.c @@ -34,19 +34,19 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/fstat/msdosfs.c,v 1.1.2.2 2001/11/21 10:49:37 dwmalone Exp $ - * $DragonFly: src/usr.bin/fstat/msdosfs.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/fstat/msdosfs.c,v 1.3 2003/08/27 03:21:49 dillon Exp $ */ +#define _KERNEL_STRUCTURES + #include #include #include #include -#define _KERNEL #include #include #include -#undef _KERNEL #include #include diff --git a/usr.bin/ipcs/ipcs.c b/usr.bin/ipcs/ipcs.c index 60d5f262ea..34d15f36e1 100644 --- a/usr.bin/ipcs/ipcs.c +++ b/usr.bin/ipcs/ipcs.c @@ -25,9 +25,11 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/usr.bin/ipcs/ipcs.c,v 1.12.2.4 2003/04/08 11:01:34 tjr Exp $ - * $DragonFly: src/usr.bin/ipcs/ipcs.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/ipcs/ipcs.c,v 1.3 2003/08/27 03:21:49 dillon Exp $ */ +#define _KERNEL_STRUCTURES + #include #include #include @@ -42,7 +44,6 @@ #include #include #include -#define _KERNEL #include #include #include diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index a6d03816f1..bc4097f744 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -33,13 +33,12 @@ * @(#) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)kdump.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/kdump/kdump.c,v 1.17 1999/12/29 05:05:33 peter Exp $ - * $DragonFly: src/usr.bin/kdump/kdump.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/kdump/kdump.c,v 1.3 2003/08/27 03:21:50 dillon Exp $ */ -#define _KERNEL -extern int errno; +#define _KERNEL_STRUCTURES + #include -#undef _KERNEL #include #include #include diff --git a/usr.bin/ktrace/subr.c b/usr.bin/ktrace/subr.c index c4cf64f1a2..c189d2d693 100644 --- a/usr.bin/ktrace/subr.c +++ b/usr.bin/ktrace/subr.c @@ -32,9 +32,11 @@ * * @(#)subr.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/ktrace/subr.c,v 1.6 1999/08/28 01:02:34 peter Exp $ - * $DragonFly: src/usr.bin/ktrace/subr.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/ktrace/subr.c,v 1.3 2003/08/27 03:21:50 dillon Exp $ */ +#define _KERNEL_STRUCTURES + #include #include #include diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 7015371e87..9e268d9a9d 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -33,9 +33,10 @@ * @(#) Copyright (c) 1980, 1986, 1991, 1993 The Regents of the University of California. All rights reserved. * @(#)vmstat.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/vmstat/vmstat.c,v 1.38.2.4 2001/07/31 19:52:41 tmm Exp $ - * $DragonFly: src/usr.bin/vmstat/vmstat.c,v 1.4 2003/07/30 05:19:54 hmp Exp $ + * $DragonFly: src/usr.bin/vmstat/vmstat.c,v 1.5 2003/08/27 03:21:50 dillon Exp $ */ +#define _KERNEL_STRUCTURES #include #include #include @@ -87,8 +88,12 @@ static struct nlist namelist[] = { { "_eintrcnt" }, #define X_KMEMSTATISTICS 9 { "_kmemstatistics" }, +#if 0 #define X_KMEMBUCKETS 10 { "_bucket" }, +#else + { "_kmemstatistics" }, +#endif #define X_ZLIST 11 { "_zlist" }, #ifdef notyet @@ -750,7 +755,11 @@ domem() char buf[1024]; struct kmembuckets buckets[MINBUCKET + 16]; +#ifdef X_KMEMBUCKETS kread(X_KMEMBUCKETS, buckets, sizeof(buckets)); +#else + bzero(buckets, sizeof(buckets)); +#endif kread(X_KMEMSTATISTICS, &kmsp, sizeof(kmsp)); for (nkms = 0; nkms < MAX_KMSTATS && kmsp != NULL; nkms++) { if (sizeof(kmemstats[0]) != kvm_read(kd, (u_long)kmsp, diff --git a/usr.sbin/ifmcstat/ifmcstat.c b/usr.sbin/ifmcstat/ifmcstat.c index 7225fa80ea..48d02c0d2e 100644 --- a/usr.sbin/ifmcstat/ifmcstat.c +++ b/usr.sbin/ifmcstat/ifmcstat.c @@ -27,9 +27,11 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/ifmcstat/ifmcstat.c,v 1.3.2.2 2001/07/03 11:02:06 ume Exp $ - * $DragonFly: src/usr.sbin/ifmcstat/ifmcstat.c,v 1.2 2003/06/17 04:29:55 dillon Exp $ + * $DragonFly: src/usr.sbin/ifmcstat/ifmcstat.c,v 1.3 2003/08/27 03:21:50 dillon Exp $ */ +#define _KERNEL_STRUCTURES + #include #include #include @@ -47,9 +49,7 @@ #include #include #include -#define _KERNEL #include -#undef _KERNEL #include #include diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c index 5065298e64..f370bf172d 100644 --- a/usr.sbin/pstat/pstat.c +++ b/usr.sbin/pstat/pstat.c @@ -33,14 +33,15 @@ * @(#) Copyright (c) 1980, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)pstat.c 8.16 (Berkeley) 5/9/95 * $FreeBSD: src/usr.sbin/pstat/pstat.c,v 1.49.2.5 2002/07/12 09:12:49 des Exp $ - * $DragonFly: src/usr.sbin/pstat/pstat.c,v 1.3 2003/08/08 04:18:47 dillon Exp $ + * $DragonFly: src/usr.sbin/pstat/pstat.c,v 1.4 2003/08/27 03:21:50 dillon Exp $ */ +#define _KERNEL_STRUCTURES + #include #include #include #include -#define _KERNEL #include #include #include @@ -48,7 +49,6 @@ #include #include #include -#undef _KERNEL #include #include #include diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c index 0ce25b43a3..ae568d0899 100644 --- a/usr.sbin/route6d/route6d.c +++ b/usr.sbin/route6d/route6d.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/usr.sbin/route6d/route6d.c,v 1.2.2.5 2001/07/03 11:02:09 ume Exp $ */ -/* $DragonFly: src/usr.sbin/route6d/route6d.c,v 1.2 2003/06/17 04:30:02 dillon Exp $ */ +/* $DragonFly: src/usr.sbin/route6d/route6d.c,v 1.3 2003/08/27 03:21:50 dillon Exp $ */ /* $KAME: route6d.c,v 1.64 2001/05/08 04:36:37 itojun Exp $ */ /* @@ -33,6 +33,8 @@ * $KAME: route6d.c,v 1.64 2001/05/08 04:36:37 itojun Exp $ */ +#define _KERNEL_STRUCTURES + #include #include @@ -61,11 +63,7 @@ #if defined(__FreeBSD__) && __FreeBSD__ >= 3 #include #endif /* __FreeBSD__ >= 3 */ -#define KERNEL 1 -#define _KERNEL 1 #include -#undef KERNEL -#undef _KERNEL #include #include #include -- 2.41.0