aboutsummaryrefslogtreecommitdiff
path: root/libiohelp/return-buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'libiohelp/return-buffer.c')
-rw-r--r--libiohelp/return-buffer.c7
1 files changed, 5 insertions, 2 deletions
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)