diff options
author | Thomas Bushnell <thomas@gnu.org> | 1999-07-11 05:27:17 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1999-07-11 05:27:17 +0000 |
commit | 601c2121002d89a651d94038483f0aae82ebb924 (patch) | |
tree | 12d17347585074f25d70dedcba9855e7ccd98ca0 /exec/hashexec.c | |
parent | 1fbf419e91c882f1098677bcd191ef792a2fa43e (diff) |
1999-07-06 Thomas Bushnell, BSG <tb@mit.edu>
* exec.c (load_section): Use mmap instead of vm_allocate when
allocating in mach_task_self ().
(servercopy): Likewise.
(do_exec): Likewise.
* hashexec.c (check_hashbang): Likewise.
Diffstat (limited to 'exec/hashexec.c')
-rw-r--r-- | exec/hashexec.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/exec/hashexec.c b/exec/hashexec.c index dabd7c00..03981da4 100644 --- a/exec/hashexec.c +++ b/exec/hashexec.c @@ -318,11 +318,15 @@ check_hashbang (struct execdata *e, = (argvlen - strlen (argv) - 1) /* existing args - old argv[0] */ + interp_len + len + namelen; /* New args */ - e->error = vm_allocate (mach_task_self (), - (vm_address_t *) &new_argv, - new_argvlen, 1); - if (e->error) - return e->error; + new_argv = mmap (0, new_argvlen, PROT_READ|PROT_WRITE, + MAP_ANON, 0, 0); + if (new_argv == (caddr_t) -1) + { + e->error = errno; + return e->error; + } + else + e->error = 0; if (! setjmp (args_faulted)) { |