<sys/dkstat.h> has not contained disk statistics since 17 years. The remaining defines from this file can already be found in <sys/sched.h>, and the variable declarations would better be in <sys/tty.h>.
The following diff thus gets rid of this file and adjusts userland to use <sys/sched.h> when applicable. Index: libexec/rpc.rstatd/rstat_proc.c =================================================================== RCS file: /cvs/src/libexec/rpc.rstatd/rstat_proc.c,v retrieving revision 1.31 diff -u -p -r1.31 rstat_proc.c --- libexec/rpc.rstatd/rstat_proc.c 8 Jul 2014 17:19:23 -0000 1.31 +++ libexec/rpc.rstatd/rstat_proc.c 6 Sep 2014 09:59:17 -0000 @@ -36,7 +36,7 @@ */ #include <sys/param.h> -#include <sys/dkstat.h> +#include <sys/sched.h> #include <sys/socket.h> #include <sys/sysctl.h> #include <net/if.h> Index: sbin/sysctl/sysctl.c =================================================================== RCS file: /cvs/src/sbin/sysctl/sysctl.c,v retrieving revision 1.203 diff -u -p -r1.203 sysctl.c --- sbin/sysctl/sysctl.c 16 Aug 2014 21:39:16 -0000 1.203 +++ sbin/sysctl/sysctl.c 6 Sep 2014 09:59:18 -0000 @@ -38,10 +38,10 @@ #include <sys/sysctl.h> #include <sys/socket.h> #include <sys/malloc.h> -#include <sys/dkstat.h> #include <sys/uio.h> #include <sys/tty.h> #include <sys/namei.h> +#include <sys/sched.h> #include <sys/sensors.h> #include <sys/vmmeter.h> #include <net/route.h> Index: sys/arch/hppa/hppa/autoconf.c =================================================================== RCS file: /cvs/src/sys/arch/hppa/hppa/autoconf.c,v retrieving revision 1.60 diff -u -p -r1.60 autoconf.c --- sys/arch/hppa/hppa/autoconf.c 4 Sep 2014 19:01:02 -0000 1.60 +++ sys/arch/hppa/hppa/autoconf.c 6 Sep 2014 09:59:18 -0000 @@ -76,7 +76,6 @@ void (*cold_hook)(int); /* see below */ * LED blinking thing */ #ifdef USELEDS -#include <sys/dkstat.h> #include <sys/kernel.h> struct timeout heartbeat_tmo; Index: sys/arch/hppa64/hppa64/autoconf.c =================================================================== RCS file: /cvs/src/sys/arch/hppa64/hppa64/autoconf.c,v retrieving revision 1.20 diff -u -p -r1.20 autoconf.c --- sys/arch/hppa64/hppa64/autoconf.c 4 Sep 2014 19:01:02 -0000 1.20 +++ sys/arch/hppa64/hppa64/autoconf.c 6 Sep 2014 09:59:18 -0000 @@ -77,7 +77,6 @@ void (*cold_hook)(int); /* see below */ * LED blinking thing */ #ifdef USELEDS -#include <sys/dkstat.h> #include <sys/kernel.h> struct timeout heartbeat_tmo; Index: sys/kern/kern_clock.c =================================================================== RCS file: /cvs/src/sys/kern/kern_clock.c,v retrieving revision 1.86 diff -u -p -r1.86 kern_clock.c --- sys/kern/kern_clock.c 4 Sep 2014 19:14:47 -0000 1.86 +++ sys/kern/kern_clock.c 6 Sep 2014 09:59:18 -0000 @@ -39,7 +39,6 @@ #include <sys/param.h> #include <sys/systm.h> -#include <sys/dkstat.h> #include <sys/timeout.h> #include <sys/kernel.h> #include <sys/limits.h> Index: sys/kern/kern_sysctl.c =================================================================== RCS file: /cvs/src/sys/kern/kern_sysctl.c,v retrieving revision 1.263 diff -u -p -r1.263 kern_sysctl.c --- sys/kern/kern_sysctl.c 4 Sep 2014 19:14:47 -0000 1.263 +++ sys/kern/kern_sysctl.c 6 Sep 2014 09:59:19 -0000 @@ -58,7 +58,6 @@ #include <sys/disk.h> #include <sys/sysctl.h> #include <sys/msgbuf.h> -#include <sys/dkstat.h> #include <sys/vmmeter.h> #include <sys/namei.h> #include <sys/exec.h> @@ -74,7 +73,7 @@ #include <sys/evcount.h> #include <sys/un.h> #include <sys/unpcb.h> - +#include <sys/sched.h> #include <sys/mount.h> #include <sys/syscallargs.h> Index: sys/kern/tty.c =================================================================== RCS file: /cvs/src/sys/kern/tty.c,v retrieving revision 1.113 diff -u -p -r1.113 tty.c --- sys/kern/tty.c 13 Jul 2014 15:29:04 -0000 1.113 +++ sys/kern/tty.c 6 Sep 2014 09:59:19 -0000 @@ -46,7 +46,6 @@ #undef TTYDEFCHARS #include <sys/file.h> #include <sys/conf.h> -#include <sys/dkstat.h> #include <sys/uio.h> #include <sys/kernel.h> #include <sys/vnode.h> Index: sys/net/if_sl.c =================================================================== RCS file: /cvs/src/sys/net/if_sl.c,v retrieving revision 1.53 diff -u -p -r1.53 if_sl.c --- sys/net/if_sl.c 22 Jul 2014 11:06:09 -0000 1.53 +++ sys/net/if_sl.c 6 Sep 2014 09:59:20 -0000 @@ -64,7 +64,6 @@ #include <sys/param.h> #include <sys/mbuf.h> -#include <sys/dkstat.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <sys/file.h> Index: sys/net/ppp_tty.c =================================================================== RCS file: /cvs/src/sys/net/ppp_tty.c,v retrieving revision 1.28 diff -u -p -r1.28 ppp_tty.c --- sys/net/ppp_tty.c 22 Jul 2014 11:06:10 -0000 1.28 +++ sys/net/ppp_tty.c 6 Sep 2014 09:59:20 -0000 @@ -101,7 +101,6 @@ #include <sys/param.h> #include <sys/proc.h> #include <sys/mbuf.h> -#include <sys/dkstat.h> #include <sys/socket.h> #include <sys/timeout.h> #include <sys/ioctl.h> Index: sys/sys/dkstat.h =================================================================== RCS file: sys/sys/dkstat.h diff -N sys/sys/dkstat.h --- sys/sys/dkstat.h 4 Sep 2014 19:14:47 -0000 1.9 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,49 +0,0 @@ -/* $OpenBSD: dkstat.h,v 1.9 2014/09/04 19:14:47 miod Exp $ */ -/* $NetBSD: dkstat.h,v 1.8 1995/12/28 19:16:31 thorpej Exp $ */ - -/*- - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * All or some portions of this file are derived from material licensed - * to the University of California by American Telephone and Telegraph - * Co. or Unix System Laboratories, Inc. and are reproduced herein with - * the permission of UNIX System Laboratories, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)dkstat.h 8.2 (Berkeley) 1/21/94 - */ - -#define CP_USER 0 -#define CP_NICE 1 -#define CP_SYS 2 -#define CP_INTR 3 -#define CP_IDLE 4 -#define CPUSTATES 5 - -#ifdef _KERNEL -extern int64_t tk_cancc, tk_nin, tk_nout, tk_rawcc; -#endif Index: sys/sys/tty.h =================================================================== RCS file: /cvs/src/sys/sys/tty.h,v retrieving revision 1.33 diff -u -p -r1.33 tty.h --- sys/sys/tty.h 13 Dec 2013 19:55:12 -0000 1.33 +++ sys/sys/tty.h 6 Sep 2014 09:59:20 -0000 @@ -247,6 +247,8 @@ extern struct ttychars ttydefaults; /* Symbolic sleep message strings. */ extern char ttyin[], ttyout[], ttopen[], ttclos[], ttybg[], ttybuf[]; +extern int64_t tk_cancc, tk_nin, tk_nout, tk_rawcc; + int sysctl_tty(int *, u_int, void *, size_t *, void *, size_t); int sysctl_pty(int *, u_int, void *, size_t *, void *, size_t); Index: usr.bin/systat/cpu.c =================================================================== RCS file: /cvs/src/usr.bin/systat/cpu.c,v retrieving revision 1.2 diff -u -p -r1.2 cpu.c --- usr.bin/systat/cpu.c 11 Sep 2013 07:01:03 -0000 1.2 +++ usr.bin/systat/cpu.c 6 Sep 2014 09:59:20 -0000 @@ -47,7 +47,7 @@ */ #include <sys/param.h> -#include <sys/dkstat.h> +#include <sys/sched.h> #include <sys/sysctl.h> #include <stdlib.h> Index: usr.bin/systat/iostat.c =================================================================== RCS file: /cvs/src/usr.bin/systat/iostat.c,v retrieving revision 1.42 diff -u -p -r1.42 iostat.c --- usr.bin/systat/iostat.c 9 Jul 2013 15:37:43 -0000 1.42 +++ usr.bin/systat/iostat.c 6 Sep 2014 09:59:20 -0000 @@ -31,11 +31,11 @@ */ #include <sys/param.h> -#include <sys/dkstat.h> #include <sys/buf.h> -#include <sys/time.h> -#include <sys/sysctl.h> #include <sys/mount.h> +#include <sys/sched.h> +#include <sys/sysctl.h> +#include <sys/time.h> #include <string.h> #include <stdlib.h> Index: usr.bin/systat/pigs.c =================================================================== RCS file: /cvs/src/usr.bin/systat/pigs.c,v retrieving revision 1.26 diff -u -p -r1.26 pigs.c --- usr.bin/systat/pigs.c 2 Jun 2013 06:23:17 -0000 1.26 +++ usr.bin/systat/pigs.c 6 Sep 2014 09:59:20 -0000 @@ -35,11 +35,11 @@ */ #include <sys/param.h> -#include <sys/dkstat.h> -#include <sys/resource.h> -#include <sys/time.h> #include <sys/proc.h> +#include <sys/resource.h> +#include <sys/sched.h> #include <sys/sysctl.h> +#include <sys/time.h> #include <curses.h> #include <math.h> Index: usr.bin/systat/vmstat.c =================================================================== RCS file: /cvs/src/usr.bin/systat/vmstat.c,v retrieving revision 1.76 diff -u -p -r1.76 vmstat.c --- usr.bin/systat/vmstat.c 8 Apr 2014 14:04:11 -0000 1.76 +++ usr.bin/systat/vmstat.c 6 Sep 2014 09:59:20 -0000 @@ -35,14 +35,13 @@ */ #include <sys/param.h> -#include <sys/dkstat.h> #include <sys/buf.h> -#include <sys/stat.h> -#include <sys/time.h> -#include <sys/sysctl.h> -#include <sys/proc.h> #include <sys/namei.h> +#include <sys/proc.h> +#include <sys/sched.h> +#include <sys/stat.h> #include <sys/sysctl.h> +#include <sys/time.h> #include <sys/vmmeter.h> #include <ctype.h> Index: usr.bin/top/machine.c =================================================================== RCS file: /cvs/src/usr.bin/top/machine.c,v retrieving revision 1.78 diff -u -p -r1.78 machine.c --- usr.bin/top/machine.c 4 Jul 2014 05:58:31 -0000 1.78 +++ usr.bin/top/machine.c 6 Sep 2014 09:59:21 -0000 @@ -35,9 +35,9 @@ #include <sys/types.h> #include <sys/param.h> -#include <sys/dkstat.h> #include <sys/mount.h> #include <sys/proc.h> +#include <sys/sched.h> #include <sys/swap.h> #include <sys/sysctl.h> Index: usr.bin/vmstat/dkstats.c =================================================================== RCS file: /cvs/src/usr.bin/vmstat/dkstats.c,v retrieving revision 1.35 diff -u -p -r1.35 dkstats.c --- usr.bin/vmstat/dkstats.c 24 Sep 2010 00:11:15 -0000 1.35 +++ usr.bin/vmstat/dkstats.c 6 Sep 2014 09:59:21 -0000 @@ -34,9 +34,9 @@ */ #include <sys/param.h> -#include <sys/dkstat.h> #include <sys/time.h> #include <sys/disk.h> +#include <sys/sched.h> #include <sys/sysctl.h> #include <sys/tty.h> Index: usr.bin/vmstat/vmstat.c =================================================================== RCS file: /cvs/src/usr.bin/vmstat/vmstat.c,v retrieving revision 1.132 diff -u -p -r1.132 vmstat.c --- usr.bin/vmstat/vmstat.c 13 Jul 2014 21:13:51 -0000 1.132 +++ usr.bin/vmstat/vmstat.c 6 Sep 2014 09:59:22 -0000 @@ -33,7 +33,6 @@ #include <sys/param.h> #include <sys/time.h> #include <sys/proc.h> -#include <sys/dkstat.h> #include <sys/buf.h> #include <sys/namei.h> #include <sys/malloc.h> @@ -42,6 +41,7 @@ #include <sys/sysctl.h> #include <sys/device.h> #include <sys/pool.h> +#include <sys/sched.h> #include <sys/vmmeter.h> #include <time.h> Index: usr.sbin/apmd/apmd.c =================================================================== RCS file: /cvs/src/usr.sbin/apmd/apmd.c,v retrieving revision 1.66 diff -u -p -r1.66 apmd.c --- usr.sbin/apmd/apmd.c 15 Aug 2014 03:51:40 -0000 1.66 +++ usr.sbin/apmd/apmd.c 6 Sep 2014 09:59:22 -0000 @@ -37,7 +37,7 @@ #include <sys/wait.h> #include <sys/event.h> #include <sys/time.h> -#include <sys/dkstat.h> +#include <sys/sched.h> #include <sys/sysctl.h> #include <stdio.h> #include <syslog.h> Index: usr.sbin/iostat/iostat.c =================================================================== RCS file: /cvs/src/usr.sbin/iostat/iostat.c,v retrieving revision 1.34 diff -u -p -r1.34 iostat.c --- usr.sbin/iostat/iostat.c 13 Feb 2014 21:01:23 -0000 1.34 +++ usr.sbin/iostat/iostat.c 6 Sep 2014 09:59:22 -0000 @@ -62,9 +62,9 @@ * SUCH DAMAGE. */ -#include <sys/dkstat.h> #include <sys/limits.h> #include <sys/time.h> +#include <sys/sched.h> #include <err.h> #include <ctype.h>
