Module Name:    src
Committed By:   pgoyette
Date:           Fri Nov  3 22:45:14 UTC 2017

Modified Files:
        src/sys/kern: kern_history.c
        src/sys/sys: kernhist.h
        src/usr.bin/vmstat: vmstat.c

Log Message:
Remove the ABI version-and-length check that was recently introduced;
sysctl(9) ABIs should be stable across versions.

XXX Pull-up to -8


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/kern/kern_history.c
cvs rdiff -u -r1.21 -r1.22 src/sys/sys/kernhist.h
cvs rdiff -u -r1.219 -r1.220 src/usr.bin/vmstat/vmstat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_history.c
diff -u src/sys/kern/kern_history.c:1.15 src/sys/kern/kern_history.c:1.16
--- src/sys/kern/kern_history.c:1.15	Sat Oct 28 00:37:11 2017
+++ src/sys/kern/kern_history.c	Fri Nov  3 22:45:14 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_history.c,v 1.15 2017/10/28 00:37:11 pgoyette Exp $	 */
+/*	$NetBSD: kern_history.c,v 1.16 2017/11/03 22:45:14 pgoyette Exp $	 */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_history.c,v 1.15 2017/10/28 00:37:11 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_history.c,v 1.16 2017/11/03 22:45:14 pgoyette Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kernhist.h"
@@ -460,12 +460,6 @@ sysctl_kernhist_helper(SYSCTLFN_ARGS)
 	buf = kmem_alloc(bufsize, KM_SLEEP);
 
 	/*
-	 * Set the export structure's version info
-	 */
-	buf->sh_version = KERNHIST_SYSCTL_VERSION;
-	buf->sh_arglen = sizeof(uintmax_t);
-
-	/*
 	 * Copy history header info to the export structure
 	 */
 	j = find_string(xlate_t, &xlate_c, h->name, h->namelen);

Index: src/sys/sys/kernhist.h
diff -u src/sys/sys/kernhist.h:1.21 src/sys/sys/kernhist.h:1.22
--- src/sys/sys/kernhist.h:1.21	Sat Oct 28 00:37:12 2017
+++ src/sys/sys/kernhist.h	Fri Nov  3 22:45:14 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kernhist.h,v 1.21 2017/10/28 00:37:12 pgoyette Exp $	*/
+/*	$NetBSD: kernhist.h,v 1.22 2017/11/03 22:45:14 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -89,8 +89,7 @@ struct sysctl_history_event {
 
 /* list of all events for a single history */
 struct sysctl_history {
-	uint16_t	sh_version;
-	uint16_t	sh_arglen;
+	uint32_t	filler;
 	uint32_t	sh_nameoffset;
 	uint32_t	sh_numentries;
 	uint32_t	sh_nextfree;

Index: src/usr.bin/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.219 src/usr.bin/vmstat/vmstat.c:1.220
--- src/usr.bin/vmstat/vmstat.c:1.219	Sat Oct 28 00:37:12 2017
+++ src/usr.bin/vmstat/vmstat.c	Fri Nov  3 22:45:14 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.219 2017/10/28 00:37:12 pgoyette Exp $ */
+/* $NetBSD: vmstat.c,v 1.220 2017/11/03 22:45:14 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)vmstat.c	8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.219 2017/10/28 00:37:12 pgoyette Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.220 2017/11/03 22:45:14 pgoyette Exp $");
 #endif
 #endif /* not lint */
 
@@ -2276,11 +2276,6 @@ hist_dodump_sysctl(int mib[], unsigned i
 	if (errno != 0)
 		err(1, "sysctl failed");
  
-	/* Make sure we've got matching versions */
-	if (hist->sh_version != KERNHIST_SYSCTL_VERSION ||
-	    hist->sh_arglen != sizeof(uintmax_t))
-		errx(1, "Kernel version or argument length mismatch!");
-
 	strp = (char *)(&hist->sh_events[hist->sh_numentries]);
  
 	(void)printf("%"PRIu32" entries, next is %"PRIu32"\n",

Reply via email to