summaryrefslogtreecommitdiff
path: root/libiohelp/return-buffer.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1999-07-11 05:28:59 +0000
committerThomas Bushnell <thomas@gnu.org>1999-07-11 05:28:59 +0000
commitad014b1412367ef9c9038b3b52fa83f6c748e520 (patch)
treea2b29af6f74fd9c25143180227cd66cb66e4c9d5 /libiohelp/return-buffer.c
parenta439e9fc84397a7a802b2e9966df6d2bf7a63e73 (diff)
1999-07-09 Thomas Bushnell, BSG <tb@mit.edu>
* return-buffer.c (iohelp_return_malloced_buffer): Use mmap instead of vm_allocate.
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)