diff options
author | Ron Yorston <rmy@pobox.com> | 2017-09-01 17:50:39 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2017-09-01 18:00:01 +0100 |
commit | dd9f552bb1fee66f3155bbbb81c677def861ada0 (patch) | |
tree | 21c7f1f333a2a58361c813311188b286ea803c9c /win32/mingw.c | |
parent | ec3ecac715b299766c101be92caf8b7cffb2a8b5 (diff) | |
download | busybox-w32-dd9f552bb1fee66f3155bbbb81c677def861ada0.tar.gz busybox-w32-dd9f552bb1fee66f3155bbbb81c677def861ada0.tar.bz2 busybox-w32-dd9f552bb1fee66f3155bbbb81c677def861ada0.zip |
ps: add support for CPU and elapsed time columns
It may be necessary to run ps as administrator to get information
about processes belonging to other users.
The code to detect GetTickCount64 at run-time was imported from
Git for Windows.
Diffstat (limited to 'win32/mingw.c')
-rw-r--r-- | win32/mingw.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index 7f37eadda..afcb6c6d2 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -707,7 +707,7 @@ int getlogin_r(char *buf, size_t len) | |||
707 | long sysconf(int name) | 707 | long sysconf(int name) |
708 | { | 708 | { |
709 | if ( name == _SC_CLK_TCK ) { | 709 | if ( name == _SC_CLK_TCK ) { |
710 | return 100; | 710 | return TICKS_PER_SECOND; |
711 | } | 711 | } |
712 | errno = EINVAL; | 712 | errno = EINVAL; |
713 | return -1; | 713 | return -1; |
@@ -1064,3 +1064,19 @@ off_t mingw_lseek(int fd, off_t offset, int whence) | |||
1064 | } | 1064 | } |
1065 | return _lseeki64(fd, offset, whence); | 1065 | return _lseeki64(fd, offset, whence); |
1066 | } | 1066 | } |
1067 | |||
1068 | #if ENABLE_FEATURE_PS_TIME || ENABLE_FEATURE_PS_LONG | ||
1069 | #undef GetTickCount64 | ||
1070 | #include "lazyload.h" | ||
1071 | |||
1072 | ULONGLONG CompatGetTickCount64(void) | ||
1073 | { | ||
1074 | DECLARE_PROC_ADDR(kernel32.dll, ULONGLONG, GetTickCount64, void); | ||
1075 | |||
1076 | if (!INIT_PROC_ADDR(GetTickCount64)) { | ||
1077 | return (ULONGLONG)GetTickCount(); | ||
1078 | } | ||
1079 | |||
1080 | return GetTickCount64(); | ||
1081 | } | ||
1082 | #endif | ||