mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-29 08:52:46 +00:00
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:
parent
05c872ad62
commit
95ba428ccb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101590
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user