From 344c50cb576d2c3922d90adb8baededc258dd599 Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Sun, 11 Jul 1999 05:30:55 +0000 Subject: 1999-07-09 Thomas Bushnell, BSG * bunzip2.c (bunzip2): Use mmap instead of vm_allocate. * copy.c (copy_read): Likewise. (copy_clone): Likewise. * encode.c (store_encode): Likewise. * gunzip.c (gunzip): Likewise. * rdwr.c (store_read): Likewise. * zero.c (zero_read): Likewise. --- libstore/rdwr.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libstore/rdwr.c') diff --git a/libstore/rdwr.c b/libstore/rdwr.c index 42006ad5..c5059536 100644 --- a/libstore/rdwr.c +++ b/libstore/rdwr.c @@ -226,10 +226,9 @@ store_read (struct store *store, make room. */ { whole_buf_len = amount; - err = vm_allocate (mach_task_self (), - (vm_address_t *)&whole_buf, amount, 1); - if (err) - return err; /* Punt early, there's nothing to clean up. */ + whole_buf = mmap (0, amount, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); + if (whole_buf == (void *) -1) + return errno; /* Punt early, there's nothing to clean up. */ } buf_end = whole_buf; -- cgit v1.2.3