summaryrefslogtreecommitdiff
path: root/libdiskfs/boot-start.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-06-04 20:50:08 +0000
committerRoland McGrath <roland@gnu.org>1999-06-04 20:50:08 +0000
commite88b187861f75fabca9f9e7979878c622f451059 (patch)
treec845e7934dc0a98412bb594f585b67c92faffab1 /libdiskfs/boot-start.c
parentfcd1f87630db24b34a503cc3152823039e900303 (diff)
1999-06-02 Roland McGrath <roland@baalperazim.frob.com>
* boot-start.c (diskfs_start_bootstrap): Pass environment collected from `environ' on to init. The kernel can send more parameters through this way without us knowing about them specifically.
Diffstat (limited to 'libdiskfs/boot-start.c')
-rw-r--r--libdiskfs/boot-start.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libdiskfs/boot-start.c b/libdiskfs/boot-start.c
index c968cf31..83ac5a91 100644
--- a/libdiskfs/boot-start.c
+++ b/libdiskfs/boot-start.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998 Free Software Foundation
+ Copyright (C) 1993,94,95,96,97,98,99 Free Software Foundation, Inc.
This file is part of the GNU Hurd.
@@ -96,8 +96,8 @@ diskfs_start_bootstrap ()
mach_port_t fdarray[3]; /* XXX */
task_t newt;
error_t err;
- char *exec_argv, *initname;
- size_t exec_argvlen;
+ char *exec_argv, *exec_env, *initname;
+ size_t exec_argvlen, exec_envlen;
struct port_info *bootinfo;
struct protid *rootpi;
mach_port_t diskfs_exec;
@@ -274,6 +274,9 @@ diskfs_start_bootstrap ()
fdarray[0] = fdarray[1] = fdarray[2] = get_console (); /* XXX */
+ err = argz_create (environ, &exec_env, &exec_envlen);
+ assert_perror (err);
+
err = task_create (mach_task_self (), 0, &newt);
assert_perror (err);
if (index (diskfs_boot_flags, 'd'))
@@ -284,13 +287,14 @@ diskfs_start_bootstrap ()
printf (" %s", basename (exec_argv));
fflush (stdout);
err = exec_exec (diskfs_exec, startup_pt, MACH_MSG_TYPE_COPY_SEND,
- newt, 0, exec_argv, exec_argvlen, 0, 0,
+ newt, 0, exec_argv, exec_argvlen, exec_env, exec_envlen,
fdarray, MACH_MSG_TYPE_COPY_SEND, 3,
portarray, MACH_MSG_TYPE_COPY_SEND, INIT_PORT_MAX,
/* Supply no intarray, since we have no info for it.
With none supplied, it will use the defaults. */
NULL, 0, 0, 0, 0, 0);
free (exec_argv);
+ free (exec_env);
mach_port_deallocate (mach_task_self (), root_pt);
mach_port_deallocate (mach_task_self (), startup_pt);
mach_port_deallocate (mach_task_self (), bootpt);