diff options
author | Ron Yorston <rmy@pobox.com> | 2021-02-19 08:42:38 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2021-02-19 08:42:38 +0000 |
commit | b4fcd6e378f30ffa36a87617d4c9e6113f70308d (patch) | |
tree | feee88334cdea39e504180ab9bfb34147515a2ec /win32/mingw.c | |
parent | 2b8770720868c750ad8609df4041337eb2c6cf71 (diff) | |
download | busybox-w32-b4fcd6e378f30ffa36a87617d4c9e6113f70308d.tar.gz busybox-w32-b4fcd6e378f30ffa36a87617d4c9e6113f70308d.tar.bz2 busybox-w32-b4fcd6e378f30ffa36a87617d4c9e6113f70308d.zip |
win32: add uptime to sysinfo(2), enable uptime applet
Fill the uptime member of the sysinfo structure. With this change
we can:
- use sysinfo(2) in the 'ps' applet;
- enable the 'uptime' applet (though without useful support for
load averages).
Diffstat (limited to '')
-rw-r--r-- | win32/mingw.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index 48d2eefa7..ddc64b43a 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -1389,6 +1389,8 @@ int sysinfo(struct sysinfo *info) | |||
1389 | info->totalswap = mem.ullTotalPageFile - mem.ullTotalPhys; | 1389 | info->totalswap = mem.ullTotalPageFile - mem.ullTotalPhys; |
1390 | info->freeswap = mem.ullAvailPageFile - mem.ullAvailPhys; | 1390 | info->freeswap = mem.ullAvailPageFile - mem.ullAvailPhys; |
1391 | 1391 | ||
1392 | info->uptime = GetTickCount64() / 1000; | ||
1393 | |||
1392 | return 0; | 1394 | return 0; |
1393 | } | 1395 | } |
1394 | 1396 | ||
@@ -1617,9 +1619,7 @@ off_t mingw_lseek(int fd, off_t offset, int whence) | |||
1617 | return _lseeki64(fd, offset, whence); | 1619 | return _lseeki64(fd, offset, whence); |
1618 | } | 1620 | } |
1619 | 1621 | ||
1620 | #if ENABLE_FEATURE_PS_TIME || ENABLE_FEATURE_PS_LONG | ||
1621 | #undef GetTickCount64 | 1622 | #undef GetTickCount64 |
1622 | |||
1623 | ULONGLONG CompatGetTickCount64(void) | 1623 | ULONGLONG CompatGetTickCount64(void) |
1624 | { | 1624 | { |
1625 | DECLARE_PROC_ADDR(ULONGLONG, GetTickCount64, void); | 1625 | DECLARE_PROC_ADDR(ULONGLONG, GetTickCount64, void); |
@@ -1630,7 +1630,6 @@ ULONGLONG CompatGetTickCount64(void) | |||
1630 | 1630 | ||
1631 | return GetTickCount64(); | 1631 | return GetTickCount64(); |
1632 | } | 1632 | } |
1633 | #endif | ||
1634 | 1633 | ||
1635 | #if ENABLE_FEATURE_INSTALLER | 1634 | #if ENABLE_FEATURE_INSTALLER |
1636 | /* | 1635 | /* |