aboutsummaryrefslogtreecommitdiff
path: root/proc/main.c
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2017-03-06 00:18:21 +0100
committerJustus Winter <justus@gnupg.org>2017-03-09 23:55:41 +0100
commit40c752c4e5e3c8c20cee345790954511e9f3825b (patch)
treef0f36672a9a53ff1c45e7642ebd6460b89856b88 /proc/main.c
parent83457a27885a177908718839e8a4f356b649f72f (diff)
downloadhurd-40c752c4e5e3c8c20cee345790954511e9f3825b.tar.gz
hurd-40c752c4e5e3c8c20cee345790954511e9f3825b.tar.bz2
hurd-40c752c4e5e3c8c20cee345790954511e9f3825b.zip
proc: Receive new-task notifications on kernel's process port.
* proc/main.c (main): Initialize 'kernel_proc' and use it to register for new-task notifications. * proc/mgt.c (S_mach_notify_new_task): Adapt receiver check. * proc/proc.h (kernel_proc): New variable.
Diffstat (limited to 'proc/main.c')
-rw-r--r--proc/main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/proc/main.c b/proc/main.c
index 5a088b71..d97650fc 100644
--- a/proc/main.c
+++ b/proc/main.c
@@ -191,8 +191,17 @@ main (int argc, char **argv, char **envp)
if (err && err != EPERM)
error (0, err, "Increasing priority failed");
+ /* Get a list of all tasks to find the kernel. */
+ /* XXX: I't be nice if GNU Mach would hand us the task port. */
+ add_tasks (MACH_PORT_NULL);
+ kernel_proc = pid_find (HURD_PID_KERNEL);
+
+ /* Register for new task notifications using the kernel's process as
+ the port. */
err = register_new_task_notification (_hurd_host_priv,
- generic_port,
+ kernel_proc
+ ? ports_get_right (kernel_proc)
+ : generic_port,
MACH_MSG_TYPE_MAKE_SEND);
if (err)
error (0, err, "Registering task notifications failed");