diff options
-rw-r--r-- | libiohelp/ChangeLog | 5 | ||||
-rw-r--r-- | libiohelp/return-buffer.c | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/libiohelp/ChangeLog b/libiohelp/ChangeLog index 0c525328..74cda5d6 100644 --- a/libiohelp/ChangeLog +++ b/libiohelp/ChangeLog @@ -2,6 +2,11 @@ * iouser-reauth.c: Add #include <sys/mman.h> for munmap decl. +1999-07-09 Thomas Bushnell, BSG <tb@mit.edu> + + * return-buffer.c (iohelp_return_malloced_buffer): Use mmap + instead of vm_allocate. + 1999-07-03 Thomas Bushnell, BSG <tb@mit.edu> * iouser-reauth.c (iohelp_reauth): Use munmap instead of diff --git a/libiohelp/return-buffer.c b/libiohelp/return-buffer.c index 22f46e54..83a34299 100644 --- a/libiohelp/return-buffer.c +++ b/libiohelp/return-buffer.c @@ -1,6 +1,6 @@ /* Make a malloced buffer suitable for returning from a mach rpc - Copyright (C) 1996, 1998 Free Software Foundation, Inc. + Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc. Written by Miles Bader <miles@gnu.org> @@ -35,7 +35,10 @@ iohelp_return_malloced_buffer (char *buf, size_t len, error_t err = 0; if (*rlen < len) - err = vm_allocate (mach_task_self (), (vm_address_t *)rbuf, len, 1); + { + *rbuf = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); + err = (*rbuf == (char *) -1) ? errno : 0; + } if (! err) { if (len) |