summaryrefslogtreecommitdiff
path: root/proc/main.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-06-05 21:18:36 +0000
committerRoland McGrath <roland@gnu.org>1999-06-05 21:18:36 +0000
commitfe62c3c56265801efa19edeea1bad9de02c72911 (patch)
treec9fa8a88d2c166c816a9645576a8b1763bbeafe3 /proc/main.c
parenta773555cd1dae38957be5b4302478cb93164f137 (diff)
1999-06-05 Roland McGrath <roland@baalperazim.frob.com>
* mgt.c (allocate_proc, complete_proc): New functions, broken out of new_proc. Remove magic handling of PIDs 0 and 1. (new_proc): Now just call those two. Made static. (create_startup_proc): New function, also broken out of old new_proc. Do special setup for PID 1 (init) proc structure here. * proc.h: Update decls. * main.c (main): Use create_startup_proc for startup_proc, and allocate_proc + complete_proc (with PID 0) for self_proc.
Diffstat (limited to 'proc/main.c')
-rw-r--r--proc/main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/proc/main.c b/proc/main.c
index 2205bc28..252edd1c 100644
--- a/proc/main.c
+++ b/proc/main.c
@@ -81,9 +81,12 @@ main (int argc, char **argv, char **envp)
sizeof (struct port_info), &genport);
generic_port = ports_get_right (genport);
- /* new_proc depends on these assignments which must occur in this order. */
- self_proc = new_proc (mach_task_self ()); /* proc 0 is the procserver */
- startup_proc = new_proc (MACH_PORT_NULL); /* proc 1 is init */
+ /* Create the initial proc object for init (PID 1). */
+ startup_proc = create_startup_proc ();
+
+ /* Create our own proc object (we are PID 0). */
+ self_proc = allocate_proc (mach_task_self ());
+ complete_proc (self_proc, 0);
startup_port = ports_get_right (startup_proc);
mach_port_insert_right (mach_task_self (), startup_port,
@@ -97,9 +100,6 @@ main (int argc, char **argv, char **envp)
_hurd_port_set (&_hurd_ports[INIT_PORT_AUTH], authserver);
mach_port_deallocate (mach_task_self (), boot);
- add_proc_to_hash (self_proc);
- add_proc_to_hash (startup_proc);
-
/* Set our own argv and envp locations. */
self_proc->p_argv = (int) argv;
self_proc->p_envp = (int) envp;