From beb095bf383cf3fcee8efeb3ca06231515bba673 Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Sat, 3 Jul 1999 23:54:41 +0000 Subject: 1999-07-03 Thomas Bushnell, BSG * info.c (get_string): Use munmap instead of vm_deallocate. (get_vector): Likewise. (get_string_array): Likewise. (S_proc_getprocinfo): Likewise. * mgt.c (S_proc_reauthenticate): Likewise. (S_proc_dostop): Likewise. (add_tasks): Likewise. --- proc/info.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'proc/info.c') diff --git a/proc/info.c b/proc/info.c index a53df08a..17fba079 100644 --- a/proc/info.c +++ b/proc/info.c @@ -177,7 +177,7 @@ get_string (task_t t, c - (char *)(data + (addr - readaddr))); } - vm_deallocate (mach_task_self (), data, readlen); + munmap ((caddr_t) data, readlen); return err; } @@ -232,7 +232,7 @@ get_vector (task_t task, /* If we didn't find the null terminator, then we will loop to read an additional page. */ scanned = data + readlen; - vm_deallocate (mach_task_self (), data, readlen); + munmap ((caddr_t) data, readlen); } while (!err && *vec == NULL); return err; @@ -266,7 +266,7 @@ get_string_array (task_t t, { free (vector); if (*buf != origbuf) - vm_deallocate (mach_task_self (), *buf, *buflen); + munmap ((caddr_t) *buf, *buflen); return err; } @@ -286,14 +286,14 @@ get_string_array (task_t t, free (string); free (vector); if (*buf != origbuf) - vm_deallocate (mach_task_self (), *buf, *buflen); + munmap ((caddr_t) *buf, *buflen); return err; } bcopy (*(char **) buf, (char *) newbuf, prev_len); bp = (char *)newbuf + prev_len; if (*buf != origbuf) - vm_deallocate (mach_task_self (), *buf, *buflen); + munmap ((caddr_t) *buf, *buflen); *buf = newbuf; *buflen = newsize; @@ -530,8 +530,7 @@ S_proc_getprocinfo (struct proc *callerp, if (waits_used > 0) bcopy (*waits, new_waits, waits_used); if (*waits_len > 0 && waits_alloced) - vm_deallocate (mach_task_self (), - (vm_address_t)*waits, *waits_len); + munmap (*waits, *waits_len); *waits = new_waits; *waits_len = new_len; waits_alloced = 1; @@ -552,14 +551,11 @@ S_proc_getprocinfo (struct proc *callerp, } if (*flags & PI_FETCH_THREADS) - { - vm_deallocate (mach_task_self (), - (vm_address_t)thds, nthreads * sizeof (thread_t)); - } + munmap (thds, nthreads * sizeof (thread_t)); if (err && pi_alloced) - vm_deallocate (mach_task_self (), (u_int) *piarray, structsize); + munmap (*piarray, structsize); if (err && waits_alloced) - vm_deallocate (mach_task_self (), (vm_address_t)*waits, *waits_len); + munmap (*waits, *waits_len); else *waits_len = waits_used; -- cgit v1.2.3