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..1e3865938d 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -2707,6 +2707,8 @@ NTSTATUS WINAPI NtQuerySystemInformation( { int i, j;
+ get_thread_times(unix_pid, -1, &spi->KernelTime, &spi->UserTime); + /* set thread info */ i = j = 0; while (ret == STATUS_SUCCESS) 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));