[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/2] startup: Mark all essential tasks as our children
From: |
Damien Zammit |
Subject: |
[PATCH 1/2] startup: Mark all essential tasks as our children |
Date: |
Sat, 8 May 2021 10:19:57 +1000 |
This marks all essential tasks as children of startup (or proc?)
With this patch, rumpdisk appears as an essential task but
cat /proc/6/stat
still fails with EIO, and the next patch catches the error by printing a
warning.
---
startup/startup.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/startup/startup.c b/startup/startup.c
index 9faeb462..ea52b1ad 100644
--- a/startup/startup.c
+++ b/startup/startup.c
@@ -350,6 +350,10 @@ request_dead_name (mach_port_t name)
static error_t
record_essential_task (const char *name, task_t task)
{
+ mach_print ("record_essential_task: ");
+ mach_print (name);
+ mach_print ("\n");
+
struct ess_task *et;
/* Record this task as essential. */
et = malloc (sizeof (struct ess_task));
@@ -368,6 +372,10 @@ record_essential_task (const char *name, task_t task)
/* Dead-name notification on the task port will tell us when it dies. */
request_dead_name (task);
+ /* Make task a child of startup */
+ if (task != mach_task_self () && task != proctask)
+ proc_child (procserver, task);
+
#if 0
/* Taking over the exception port will give us a better chance
if the task tries to get wedged on a fault. */
--
2.31.0
- [PATCH 1/2] startup: Mark all essential tasks as our children,
Damien Zammit <=