gnu: gnumach: Fix task_info.
This fixes the (times) call in Guile. * gnu/packages/patches/gnumach-fix-task_info.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/hurd.scm (gnumach)[source]: Use it. Change-Id: Ie7725d86465136a8e03838b86424c25cf68945c4
This commit is contained in:
parent
01d32e4744
commit
e5ee9403af
@ -1432,6 +1432,7 @@ dist_patch_DATA = \
|
||||
%D%/packages/patches/gnome-tweaks-search-paths.patch \
|
||||
%D%/packages/patches/gnulib-bootstrap.patch \
|
||||
%D%/packages/patches/gnumach-fix-i686-linux-build.patch \
|
||||
%D%/packages/patches/gnumach-fix-task_info.patch \
|
||||
%D%/packages/patches/gnumach-support-noide.patch \
|
||||
%D%/packages/patches/gnupg-default-pinentry.patch \
|
||||
%D%/packages/patches/gnupg-1-build-with-gcc10.patch \
|
||||
|
@ -256,7 +256,8 @@ Hurd-minimal package which are needed for both glibc and GCC.")
|
||||
(patches
|
||||
(append
|
||||
(search-patches "gnumach-support-noide.patch"
|
||||
"gnumach-fix-i686-linux-build.patch")
|
||||
"gnumach-fix-i686-linux-build.patch"
|
||||
"gnumach-fix-task_info.patch")
|
||||
(origin-patches (package-source gnumach-headers))))))
|
||||
(arguments
|
||||
(substitute-keyword-arguments (package-arguments gnumach-headers)
|
||||
|
59
gnu/packages/patches/gnumach-fix-task_info.patch
Normal file
59
gnu/packages/patches/gnumach-fix-task_info.patch
Normal file
@ -0,0 +1,59 @@
|
||||
Upstream status: Taken from upstream.
|
||||
|
||||
From 9949068745e2b0ca91e17125d037f332d20a0213 Mon Sep 17 00:00:00 2001
|
||||
From: Flavio Cruz <flaviocruz@gmail.com>
|
||||
Date: Tue, 16 May 2023 23:01:01 -0400
|
||||
Subject: [PATCH] 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>
|
||||
---
|
||||
include/mach/task_info.h | 6 ++++++
|
||||
kern/task.c | 8 +++++++-
|
||||
2 files changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/mach/task_info.h b/include/mach/task_info.h
|
||||
index f448ee04..39659ee6 100644
|
||||
--- a/include/mach/task_info.h
|
||||
+++ b/include/mach/task_info.h
|
||||
@@ -89,10 +89,16 @@ typedef struct task_events_info *task_events_info_t;
|
||||
only accurate if suspended */
|
||||
|
||||
struct task_thread_times_info {
|
||||
+ /* Deprecated, please use user_time64 */
|
||||
rpc_time_value_t user_time; /* total user run time for
|
||||
live threads */
|
||||
+ /* Deprecated, please use system_time64 */
|
||||
rpc_time_value_t system_time; /* total system run time for
|
||||
live threads */
|
||||
+ time_value64_t user_time64; /* total user run time for
|
||||
+ live threads */
|
||||
+ time_value64_t system_time64; /* total system run time for
|
||||
+ live threads */
|
||||
};
|
||||
|
||||
typedef struct task_thread_times_info task_thread_times_info_data_t;
|
||||
diff --git a/kern/task.c b/kern/task.c
|
||||
index 65191f5d..81817083 100644
|
||||
--- a/kern/task.c
|
||||
+++ b/kern/task.c
|
||||
@@ -881,8 +881,14 @@ kern_return_t task_info(
|
||||
task_unlock(task);
|
||||
TIME_VALUE64_TO_TIME_VALUE(&acc_user_time, ×_info->user_time);
|
||||
TIME_VALUE64_TO_TIME_VALUE(&acc_system_time, ×_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;
|
||||
}
|
||||
|
||||
--
|
||||
2.41.0
|
||||
|
Loading…
Reference in New Issue
Block a user