From 601c2121002d89a651d94038483f0aae82ebb924 Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Sun, 11 Jul 1999 05:27:17 +0000 Subject: 1999-07-06 Thomas Bushnell, BSG * 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. --- exec/hashexec.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'exec/hashexec.c') 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)) { -- cgit v1.2.3