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.
This commit is contained in:
parent
7fe1831b09
commit
d4305dc776
8
external/bsd/top/dist/machine/m_netbsd.c
vendored
8
external/bsd/top/dist/machine/m_netbsd.c
vendored
@ -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>
|
||||
*
|
||||
*
|
||||
* $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 @@ machine_init(statics)
|
||||
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;
|
||||
|
@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1991, 1993, 1994\
|
||||
#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 @@ __RCSID("$NetBSD: w.c,v 1.83 2016/11/16 02:03:30 christos Exp $");
|
||||
|
||||
#include "extern.h"
|
||||
|
||||
struct timeval boottime;
|
||||
struct timespec boottime;
|
||||
struct winsize ws;
|
||||
kvm_t *kd;
|
||||
time_t now; /* the current time of day */
|
||||
|
@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\
|
||||
#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 @@ getboottime(void)
|
||||
{
|
||||
int mib[2];
|
||||
size_t size;
|
||||
struct timeval tm;
|
||||
struct timespec tm;
|
||||
|
||||
mib[0] = CTL_KERN;
|
||||
mib[1] = KERN_BOOTTIME;
|
||||
|
Loading…
Reference in New Issue
Block a user