Source-Changes-HG archive

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

[src/trunk]: src sysctl(KERN_BOPOTIME) started returning a struct timespec in...



details:   https://anonhg.NetBSD.org/src/rev/83bf659b8f74
branches:  trunk
changeset: 445492:83bf659b8f74
user:      kre <kre%NetBSD.org@localhost>
date:      Tue Oct 30 21:15:09 2018 +0000

description:
sysctl(KERN_BOPOTIME) started returning a struct timespec in 2009.
Update to match....    We're slow but we get there eventually!

NFC for any of these programs, struct timeval and struct timespec
are the same size, and only the tv_sec field of boottime is used,
and that's unchanged.

diffstat:

 external/bsd/top/dist/machine/m_netbsd.c |  8 ++++----
 usr.bin/w/w.c                            |  6 +++---
 usr.sbin/rwhod/rwhod.c                   |  6 +++---
 3 files changed, 10 insertions(+), 10 deletions(-)

diffs (87 lines):

diff -r 18b3f76452c5 -r 83bf659b8f74 external/bsd/top/dist/machine/m_netbsd.c
--- a/external/bsd/top/dist/machine/m_netbsd.c  Tue Oct 30 20:23:29 2018 +0000
+++ b/external/bsd/top/dist/machine/m_netbsd.c  Tue Oct 30 21:15:09 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: m_netbsd.c,v 1.20 2018/05/31 10:14:21 kamil Exp $      */
+/*     $NetBSD: m_netbsd.c,v 1.21 2018/10/30 21:15:09 kre Exp $        */
 
 /*
  * top - a top users display for Unix
@@ -37,12 +37,12 @@
  *             Andrew Doran <ad%NetBSD.org@localhost>
  *
  *
- * $Id: m_netbsd.c,v 1.20 2018/05/31 10:14:21 kamil Exp $
+ * $Id: m_netbsd.c,v 1.21 2018/10/30 21:15:09 kre Exp $
  */
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: m_netbsd.c,v 1.20 2018/05/31 10:14:21 kamil Exp $");
+__RCSID("$NetBSD: m_netbsd.c,v 1.21 2018/10/30 21:15:09 kre Exp $");
 #endif
 
 #include <sys/param.h>
@@ -306,7 +306,7 @@
        int mib[2];
        size_t size;
        struct clockinfo clockinfo;
-       struct timeval boottime;
+       struct timespec boottime;
 
        if ((kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, "kvm_open")) == NULL)
                return -1;
diff -r 18b3f76452c5 -r 83bf659b8f74 usr.bin/w/w.c
--- a/usr.bin/w/w.c     Tue Oct 30 20:23:29 2018 +0000
+++ b/usr.bin/w/w.c     Tue Oct 30 21:15:09 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: w.c,v 1.83 2016/11/16 02:03:30 christos Exp $  */
+/*     $NetBSD: w.c,v 1.84 2018/10/30 21:15:09 kre Exp $       */
 
 /*-
  * Copyright (c) 1980, 1991, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)w.c        8.6 (Berkeley) 6/30/94";
 #else
-__RCSID("$NetBSD: w.c,v 1.83 2016/11/16 02:03:30 christos Exp $");
+__RCSID("$NetBSD: w.c,v 1.84 2018/10/30 21:15:09 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -86,7 +86,7 @@
 
 #include "extern.h"
 
-struct timeval boottime;
+struct timespec        boottime;
 struct winsize ws;
 kvm_t         *kd;
 time_t         now;            /* the current time of day */
diff -r 18b3f76452c5 -r 83bf659b8f74 usr.sbin/rwhod/rwhod.c
--- a/usr.sbin/rwhod/rwhod.c    Tue Oct 30 20:23:29 2018 +0000
+++ b/usr.sbin/rwhod/rwhod.c    Tue Oct 30 21:15:09 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rwhod.c,v 1.40 2012/11/04 22:32:01 christos Exp $      */
+/*     $NetBSD: rwhod.c,v 1.41 2018/10/30 21:15:09 kre Exp $   */
 
 /*
  * Copyright (c) 1983, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)rwhod.c    8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: rwhod.c,v 1.40 2012/11/04 22:32:01 christos Exp $");
+__RCSID("$NetBSD: rwhod.c,v 1.41 2018/10/30 21:15:09 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -426,7 +426,7 @@
 {
        int mib[2];
        size_t size;
-       struct timeval tm;
+       struct timespec tm;
 
        mib[0] = CTL_KERN;
        mib[1] = KERN_BOOTTIME;



Home | Main Index | Thread Index | Old Index