summaryrefslogtreecommitdiff
path: root/proc
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1999-07-03 23:54:41 +0000
committerThomas Bushnell <thomas@gnu.org>1999-07-03 23:54:41 +0000
commitbeb095bf383cf3fcee8efeb3ca06231515bba673 (patch)
tree3f712e48ec7fb5e2d571ef250d1d9df3642cb6d9 /proc
parent3d107d5b12ac76a37621e589ebc03540205b488f (diff)
1999-07-03 Thomas Bushnell, BSG <tb@mit.edu>
* 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.
Diffstat (limited to 'proc')
-rw-r--r--proc/ChangeLog10
-rw-r--r--proc/info.c22
-rw-r--r--proc/mgt.c21
3 files changed, 26 insertions, 27 deletions
diff --git a/proc/ChangeLog b/proc/ChangeLog
index 4c531eab..6e47b4a4 100644
--- a/proc/ChangeLog
+++ b/proc/ChangeLog
@@ -1,3 +1,13 @@
+1999-07-03 Thomas Bushnell, BSG <tb@mit.edu>
+
+ * 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.
+
1999-06-19 Roland McGrath <roland@baalperazim.frob.com>
* main.c (main): Remove commented-out wire_task_self call, #include.
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;
diff --git a/proc/mgt.c b/proc/mgt.c
index bcf18243..643ea34c 100644
--- a/proc/mgt.c
+++ b/proc/mgt.c
@@ -115,17 +115,13 @@ S_proc_reauthenticate (struct proc *p, mach_port_t rendport)
p->p_id = make_ids (gen_uids, ngen_uids, gen_gids, ngen_gids);
if (gen_uids != gubuf)
- vm_deallocate (mach_task_self (), (u_int) gen_uids,
- ngen_uids * sizeof (uid_t));
+ munmap (gen_uids, ngen_uids * sizeof (uid_t));
if (aux_uids != aubuf)
- vm_deallocate (mach_task_self (), (u_int) aux_uids,
- naux_uids * sizeof (uid_t));
+ munmap (aux_uids, naux_uids * sizeof (uid_t));
if (gen_gids != ggbuf)
- vm_deallocate (mach_task_self (), (u_int) gen_gids,
- ngen_gids * sizeof (uid_t));
+ munmap (gen_gids, ngen_gids * sizeof (uid_t));
if (aux_gids != agbuf)
- vm_deallocate (mach_task_self (), (u_int) aux_gids,
- naux_gids * sizeof (uid_t));
+ munmap (aux_gids, naux_gids * sizeof (uid_t));
return 0;
}
@@ -335,8 +331,7 @@ S_proc_dostop (struct proc *p,
mach_port_deallocate (mach_task_self (), threads[i]);
}
if (threads != threadbuf)
- vm_deallocate (mach_task_self (), (vm_address_t) threads,
- nthreads * sizeof (thread_t));
+ munmap (threads, nthreads * sizeof (thread_t));
err = task_resume (p->p_task);
if (err)
return err;
@@ -770,14 +765,12 @@ add_tasks (task_t task)
if (!set)
mach_port_deallocate (mach_task_self (), tasks[j]);
}
- vm_deallocate (mach_task_self (), (vm_address_t) tasks,
- ntasks * sizeof (task_t));
+ munmap (tasks, ntasks * sizeof (task_t));
mach_port_deallocate (mach_task_self (), psetpriv);
}
mach_port_deallocate (mach_task_self (), psets[i]);
}
- vm_deallocate (mach_task_self (), (vm_address_t) psets,
- npsets * sizeof (mach_port_t));
+ munmap (psets, npsets * sizeof (mach_port_t));
return foundp;
}