about summary refs log tree commit diff
path: root/hurd
diff options
context:
space:
mode:
Diffstat (limited to 'hurd')
-rw-r--r--hurd/hurdinit.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/hurd/hurdinit.c b/hurd/hurdinit.c
index a884b78de6..e4ec005b48 100644
--- a/hurd/hurdinit.c
+++ b/hurd/hurdinit.c
@@ -34,6 +34,10 @@ sigset_t _hurdsig_traced;
 char **__libc_argv;
 int __libc_argc;
 
+static int *_hurd_intarray;
+static size_t _hurd_intarraysize;
+static mach_port_t *_hurd_portarray;
+static size_t _hurd_portarraysize;
 
 error_t
 _hurd_ports_use (int which, error_t (*operate) (mach_port_t))
@@ -87,17 +91,10 @@ _hurd_init (int flags, char **argv,
   if (intarraysize > INIT_TRACEMASK)
     _hurdsig_traced = intarray[INIT_TRACEMASK];
 
-  /* Tell the proc server we exist, if it does.  */
-  if (portarray[INIT_PORT_PROC] != MACH_PORT_NULL)
-    _hurd_new_proc_init (argv, intarray, intarraysize);
-
-  /* All done with init ints and ports.  */
-  __vm_deallocate (__mach_task_self (),
-		   (vm_address_t) intarray,
-		   intarraysize * sizeof (int));
-  __vm_deallocate (__mach_task_self (),
-		   (vm_address_t) portarray,
-		   portarraysize * sizeof (mach_port_t));
+  _hurd_intarray = intarray;
+  _hurd_intarraysize = intarraysize;
+  _hurd_portarray = portarray;
+  _hurd_portarraysize = portarraysize;
 
   if (flags & EXEC_SECURE)
     {
@@ -113,6 +110,23 @@ _hurd_init (int flags, char **argv,
   RUN_HOOK (_hurd_subinit, ());
 }
 libc_hidden_def (_hurd_init)
+
+void
+_hurd_libc_proc_init (char **argv)
+{
+  /* Tell the proc server we exist, if it does.  */
+  if (_hurd_portarray[INIT_PORT_PROC] != MACH_PORT_NULL)
+    _hurd_new_proc_init (argv, _hurd_intarray, _hurd_intarraysize);
+
+  /* All done with init ints and ports.  */
+  __vm_deallocate (__mach_task_self (),
+		   (vm_address_t) _hurd_intarray,
+		   _hurd_intarraysize * sizeof (int));
+  __vm_deallocate (__mach_task_self (),
+		   (vm_address_t) _hurd_portarray,
+		   _hurd_portarraysize * sizeof (mach_port_t));
+}
+libc_hidden_def (_hurd_libc_proc_init)
 
 #include <hurd/signal.h>