From ad014b1412367ef9c9038b3b52fa83f6c748e520 Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Sun, 11 Jul 1999 05:28:59 +0000 Subject: 1999-07-09 Thomas Bushnell, BSG * return-buffer.c (iohelp_return_malloced_buffer): Use mmap instead of vm_allocate. --- libiohelp/return-buffer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libiohelp/return-buffer.c') 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 @@ -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) -- cgit v1.2.3