summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authortmm <tmm@FreeBSD.org>2002-08-09 15:47:43 +0000
committertmm <tmm@FreeBSD.org>2002-08-09 15:47:43 +0000
commitc516cea85b5d127aeec661bbe20bba53613e3069 (patch)
tree4171992d8ce37373c2cec9b8494c98429927eeae /usr.bin
parenta59a8c94a5f5fe3ec1050bbafb784d4924253572 (diff)
downloadFreeBSD-src-c516cea85b5d127aeec661bbe20bba53613e3069.zip
FreeBSD-src-c516cea85b5d127aeec661bbe20bba53613e3069.tar.gz
The boottime variable in sys/kern/kern_tc.c is a struct timeval, not a
time_t, so do not use the latter as type when retrieving the variable via libkvm. This should fix vmstat on sparc64.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/vmstat/vmstat.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index c70cc1f..54c51ed 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -385,13 +385,14 @@ getdrivedata(argv)
long
getuptime()
{
- static time_t now, boottime;
+ static struct timeval boottime;
+ static time_t now;
time_t uptime;
- if (boottime == 0)
+ if (boottime.tv_sec == 0)
kread(X_BOOTTIME, &boottime, sizeof(boottime));
(void)time(&now);
- uptime = now - boottime;
+ uptime = now - boottime.tv_sec;
if (uptime <= 0 || uptime > 60*60*24*365*10)
errx(1, "time makes no sense; namelist must be wrong");
return(uptime);
OpenPOWER on IntegriCloud