From 157a9dcf73718cf04690b1646995549a52cee43d Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Sat, 3 Jul 1999 23:52:06 +0000 Subject: 1999-07-03 Thomas Bushnell, BSG * fsysops.c (fsys_get_readonly): Use munmap instead of vm_deallocate. * idvec-auth.c (idvec_merge_auth): Likewise. * portinfo.c (print_port_info): Likewise. (print_task_ports_info): Likewise. * portxlate.c (port_name_xlator_create): Likewise. (port_name_xlator_free): Likewise. * xportinfo.c (print_xlated_task_ports_info): Likewise. --- libshouldbeinlibc/ChangeLog | 10 ++++++++++ libshouldbeinlibc/fsysops.c | 4 ++-- libshouldbeinlibc/idvec-auth.c | 10 +++++----- libshouldbeinlibc/portinfo.c | 11 ++++------- libshouldbeinlibc/portxlate.c | 18 +++++------------- libshouldbeinlibc/xportinfo.c | 8 +++----- 6 files changed, 29 insertions(+), 32 deletions(-) (limited to 'libshouldbeinlibc') diff --git a/libshouldbeinlibc/ChangeLog b/libshouldbeinlibc/ChangeLog index ebb98222..f6667d5e 100644 --- a/libshouldbeinlibc/ChangeLog +++ b/libshouldbeinlibc/ChangeLog @@ -1,3 +1,13 @@ +1999-07-03 Thomas Bushnell, BSG + + * fsysops.c (fsys_get_readonly): Use munmap instead of vm_deallocate. + * idvec-auth.c (idvec_merge_auth): Likewise. + * portinfo.c (print_port_info): Likewise. + (print_task_ports_info): Likewise. + * portxlate.c (port_name_xlator_create): Likewise. + (port_name_xlator_free): Likewise. + * xportinfo.c (print_xlated_task_ports_info): Likewise. + 1999-05-23 Roland McGrath * idvec-verify.c (SHADOW_PASSWORD_STRING): New macro. diff --git a/libshouldbeinlibc/fsysops.c b/libshouldbeinlibc/fsysops.c index 215c639f..57046e21 100644 --- a/libshouldbeinlibc/fsysops.c +++ b/libshouldbeinlibc/fsysops.c @@ -1,6 +1,6 @@ /* Some handy utility routines for fsys control ports - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1999 Free Software Foundation, Inc. Written by Miles Bader @@ -74,7 +74,7 @@ fsys_get_readonly (fsys_t fsys, int *readonly) if (opts != _opts) /* Free out-of-line memory returned by fsys_get_options. */ - vm_deallocate (mach_task_self (), (vm_address_t)opts, opts_len); + munmap (opts, opts_len); } return err; diff --git a/libshouldbeinlibc/idvec-auth.c b/libshouldbeinlibc/idvec-auth.c index d03233be..3131e61e 100644 --- a/libshouldbeinlibc/idvec-auth.c +++ b/libshouldbeinlibc/idvec-auth.c @@ -1,6 +1,6 @@ /* Idvec functions that interact with an auth server - Copyright (C) 1995, 1998 Free Software Foundation, Inc. + Copyright (C) 1995, 1998, 1999 Free Software Foundation, Inc. Written by Miles Bader @@ -66,13 +66,13 @@ idvec_merge_auth (struct idvec *eff_uids, struct idvec *avail_uids, /* Deallocate any out-of-line memory we got back. */ if (_eff_uids != eff_uid_buf) - vm_deallocate (mach_task_self (), (vm_address_t)_eff_uids, num_eff_uids); + munmap (_eff_uids, num_eff_uids); if (_avail_uids != avail_uid_buf) - vm_deallocate (mach_task_self (), (vm_address_t)_avail_uids, num_avail_uids); + munmap (_avail_uids, num_avail_uids); if (_eff_gids != eff_gid_buf) - vm_deallocate (mach_task_self (), (vm_address_t)_eff_gids, num_eff_gids); + munmap (_eff_gids, num_eff_gids); if (_avail_gids != avail_gid_buf) - vm_deallocate (mach_task_self (), (vm_address_t)_avail_gids, num_avail_gids); + munmap (_avail_gids, num_avail_gids); return err; } diff --git a/libshouldbeinlibc/portinfo.c b/libshouldbeinlibc/portinfo.c index 4f3ff40b..19e954c8 100644 --- a/libshouldbeinlibc/portinfo.c +++ b/libshouldbeinlibc/portinfo.c @@ -1,6 +1,6 @@ /* Print information about a task's ports - Copyright (C) 1996, 1998 Free Software Foundation, Inc. + Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc. Written by Miles Bader @@ -121,8 +121,7 @@ print_port_info (mach_port_t name, mach_port_type_t type, task_t task, for (i = 1; i < members_len; i++) fprintf (stream, hex_names ? ", %#x" : ", %u", members[i]); fprintf (stream, ")"); - vm_deallocate (mach_task_self (), (vm_address_t)members, - members_len * sizeof *members); + munmap (members, members_len * sizeof *members); } } } @@ -149,10 +148,8 @@ print_task_ports_info (task_t task, mach_port_type_t only, if (types[i] & only) print_port_info (names[i], types[i], task, show, stream); - vm_deallocate (mach_task_self (), - (vm_address_t)names, names_len * sizeof *names); - vm_deallocate (mach_task_self (), - (vm_address_t)types, types_len * sizeof *types); + munmap (names, names_len * sizeof *names); + munmap (types, types_len * sizeof *types); return 0; } diff --git a/libshouldbeinlibc/portxlate.c b/libshouldbeinlibc/portxlate.c index 07b2fc03..087e0850 100644 --- a/libshouldbeinlibc/portxlate.c +++ b/libshouldbeinlibc/portxlate.c @@ -1,6 +1,6 @@ /* Translate mach port names between two tasks - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1999 Free Software Foundation, Inc. Written by Miles Bader @@ -59,12 +59,8 @@ port_name_xlator_create (mach_port_t from_task, mach_port_t to_task, } else { - vm_deallocate (mach_task_self (), - (vm_address_t)x->to_names, - x->to_names_len * sizeof (mach_port_t)); - vm_deallocate (mach_task_self (), - (vm_address_t)x->to_types, - x->to_types_len * sizeof (mach_port_type_t)); + munmap (x->to_names, x->to_names_len * sizeof (mach_port_t)); + munmap (x->to_types, x->to_types_len * sizeof (mach_port_type_t)); err = ENOMEM; } } @@ -88,12 +84,8 @@ port_name_xlator_free (struct port_name_xlator *x) mach_port_deallocate (mach_task_self (), x->ports[i]); free (x->ports); - vm_deallocate (mach_task_self (), - (vm_address_t)x->to_names, - x->to_names_len * sizeof (mach_port_t)); - vm_deallocate (mach_task_self (), - (vm_address_t)x->to_types, - x->to_types_len * sizeof (mach_port_type_t)); + munmap (x->to_names, x->to_names_len * sizeof (mach_port_t)); + munmap (x->to_types, x->to_types_len * sizeof (mach_port_type_t)); mach_port_deallocate (mach_task_self (), x->to_task); mach_port_deallocate (mach_task_self (), x->from_task); diff --git a/libshouldbeinlibc/xportinfo.c b/libshouldbeinlibc/xportinfo.c index cdd1da38..bcd6abfa 100644 --- a/libshouldbeinlibc/xportinfo.c +++ b/libshouldbeinlibc/xportinfo.c @@ -1,6 +1,6 @@ /* Print information about a port, with the name translated between tasks - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1999 Free Software Foundation, Inc. Written by Miles Bader @@ -59,10 +59,8 @@ print_xlated_task_ports_info (struct port_name_xlator *x, if (types[i] & only) print_xlated_port_info (names[i], types[i], x, show, stream); - vm_deallocate (mach_task_self (), - (vm_address_t)names, names_len * sizeof *names); - vm_deallocate (mach_task_self (), - (vm_address_t)types, types_len * sizeof *types); + munmap (names, names_len * sizeof *names); + munmap (types, types_len * sizeof *types); return 0; } -- cgit v1.2.3