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.
This commit is contained in:
Thomas Moestl 2002-08-09 15:47:43 +00:00
parent 05c872ad62
commit 95ba428ccb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101590

View File

@ -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);