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/zero.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'libstore/zero.c') diff --git a/libstore/zero.c b/libstore/zero.c index d94cbdcf..33e34142 100644 --- a/libstore/zero.c +++ b/libstore/zero.c @@ -1,6 +1,6 @@ /* Zero store backend - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc. Written by Miles Bader This file is part of the GNU Hurd. @@ -32,18 +32,17 @@ zero_read (struct store *store, { if (*len < amount) { - error_t err = - vm_allocate (mach_task_self (), (vm_address_t *)buf, amount, 1); - if (! err) - *len = amount; - return err; - } - else - { - bzero (*buf, amount); + *buf = mmap (0, amount, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); + if (*buf == (void *) -1) + return errno; *len = amount; return 0; } + else + bzero (*buf, amount); + + *len = amount; + return 0; } static error_t -- cgit v1.2.3