Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Remove the ABI version-and-length check that was recently in...



details:   https://anonhg.NetBSD.org/src/rev/498e727fe19a
branches:  trunk
changeset: 827570:498e727fe19a
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Fri Nov 03 22:45:14 2017 +0000

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

XXX Pull-up to -8

diffstat:

 sys/kern/kern_history.c |  10 ++--------
 sys/sys/kernhist.h      |   5 ++---
 usr.bin/vmstat/vmstat.c |   9 ++-------
 3 files changed, 6 insertions(+), 18 deletions(-)

diffs (80 lines):

diff -r 3db5846296e9 -r 498e727fe19a sys/kern/kern_history.c
--- a/sys/kern/kern_history.c   Fri Nov 03 21:15:18 2017 +0000
+++ b/sys/kern/kern_history.c   Fri Nov 03 22:45:14 2017 +0000
@@ -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 @@
        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);
diff -r 3db5846296e9 -r 498e727fe19a sys/sys/kernhist.h
--- a/sys/sys/kernhist.h        Fri Nov 03 21:15:18 2017 +0000
+++ b/sys/sys/kernhist.h        Fri Nov 03 22:45:14 2017 +0000
@@ -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 @@
 
 /* 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;
diff -r 3db5846296e9 -r 498e727fe19a usr.bin/vmstat/vmstat.c
--- a/usr.bin/vmstat/vmstat.c   Fri Nov 03 21:15:18 2017 +0000
+++ b/usr.bin/vmstat/vmstat.c   Fri Nov 03 22:45:14 2017 +0000
@@ -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 @@
 #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 @@
        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",



Home | Main Index | Thread Index | Old Index