From: Michael Müller michael@fds-team.de
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntdll/nt.c | 2 ++ dlls/ntdll/thread.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 9b5bbd09ee..5ff9c4bebf 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -2703,6 +2703,8 @@ NTSTATUS WINAPI NtQuerySystemInformation( break; }
+ get_thread_times(unix_pid, -1, &spi->KernelTime, &spi->UserTime); + if (Length >= len) { int i, j; diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index c0821bcf13..83bfeb40d0 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -777,7 +777,10 @@ BOOL get_thread_times(int unix_pid, int unix_tid, LARGE_INTEGER *kernel_time, LA FILE *f; int i;
- sprintf( buf, "/proc/%u/task/%u/stat", unix_pid, unix_tid ); + if (unix_tid == -1) + sprintf( buf, "/proc/%u/stat", unix_pid ); + else + sprintf( buf, "/proc/%u/task/%u/stat", unix_pid, unix_tid ); if (!(f = fopen( buf, "r" ))) { ERR("Failed to open %s: %s\n", buf, strerror(errno));