aboutsummaryrefslogtreecommitdiff
path: root/kern/task.c
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2023-05-16 23:01:01 -0400
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-05-17 19:25:02 +0200
commit25a3748b9028b5207e419fc49b6178b1b6405fa8 (patch)
tree5e0563f9fa8cdaa9b416023fc2ade858c641536b /kern/task.c
parentb16f119edb80e913fdd60fc3bf381afb504509fd (diff)
downloadgnumach-25a3748b9028b5207e419fc49b6178b1b6405fa8.tar.gz
gnumach-25a3748b9028b5207e419fc49b6178b1b6405fa8.tar.bz2
gnumach-25a3748b9028b5207e419fc49b6178b1b6405fa8.zip
Fix task_info for TASK_THREAD_TIMES_INFO.
We are checking for the existence of time_value64_t but we didn't add that to the task_thread_times_info structure. Message-Id: <ZGRDbS0XIm1fJwkG@jupiter.tail36e24.ts.net>
Diffstat (limited to 'kern/task.c')
-rw-r--r--kern/task.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/kern/task.c b/kern/task.c
index 9492b448..60ab4d73 100644
--- a/kern/task.c
+++ b/kern/task.c
@@ -887,8 +887,14 @@ kern_return_t task_info(
task_unlock(task);
TIME_VALUE64_TO_TIME_VALUE(&acc_user_time, &times_info->user_time);
TIME_VALUE64_TO_TIME_VALUE(&acc_system_time, &times_info->system_time);
+ if (*task_info_count >= TASK_THREAD_TIMES_INFO_COUNT) {
+ /* Copy new time_value64_t fields */
+ times_info->user_time64 = acc_user_time;
+ times_info->system_time64 = acc_system_time;
+ }
- *task_info_count = TASK_THREAD_TIMES_INFO_COUNT;
+ if (*task_info_count > TASK_THREAD_TIMES_INFO_COUNT)
+ *task_info_count = TASK_THREAD_TIMES_INFO_COUNT;
break;
}