Remove the ABI version-and-length check that was recently introduced;

sysctl(9) ABIs should be stable across versions.

XXX Pull-up to -8
This commit is contained in:
pgoyette 2017-11-03 22:45:14 +00:00
parent 96fab80f5b
commit 64ae8753d8
3 changed files with 6 additions and 18 deletions

View File

@ -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. * Copyright (c) 1997 Charles D. Cranor and Washington University.
@ -33,7 +33,7 @@
*/ */
#include <sys/cdefs.h> #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_ddb.h"
#include "opt_kernhist.h" #include "opt_kernhist.h"
@ -459,12 +459,6 @@ sysctl_kernhist_helper(SYSCTLFN_ARGS)
xlate_t[xlate_c].offset; xlate_t[xlate_c].offset;
buf = kmem_alloc(bufsize, KM_SLEEP); 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 * Copy history header info to the export structure
*/ */

View File

@ -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. * 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 */ /* list of all events for a single history */
struct sysctl_history { struct sysctl_history {
uint16_t sh_version; uint32_t filler;
uint16_t sh_arglen;
uint32_t sh_nameoffset; uint32_t sh_nameoffset;
uint32_t sh_numentries; uint32_t sh_numentries;
uint32_t sh_nextfree; uint32_t sh_nextfree;

View File

@ -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. * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@ -70,7 +70,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1986, 1991, 1993\
#if 0 #if 0
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 3/1/95"; static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 3/1/95";
#else #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
#endif /* not lint */ #endif /* not lint */
@ -2276,11 +2276,6 @@ hist_dodump_sysctl(int mib[], unsigned int miblen)
if (errno != 0) if (errno != 0)
err(1, "sysctl failed"); 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]); strp = (char *)(&hist->sh_events[hist->sh_numentries]);
(void)printf("%"PRIu32" entries, next is %"PRIu32"\n", (void)printf("%"PRIu32" entries, next is %"PRIu32"\n",