diff options
author | Thomas Bushnell <thomas@gnu.org> | 1999-07-11 05:32:14 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1999-07-11 05:32:14 +0000 |
commit | cd19ba270757a36b05b776253391debcef50d65c (patch) | |
tree | dcbb0706bad75c4150c2fda310ad1d5bf2733a7d /storeio/dev.c | |
parent | 787cf415c05ca62623d6e5b0f94ff61c13eb08ad (diff) | |
download | hurd-cd19ba270757a36b05b776253391debcef50d65c.tar.gz hurd-cd19ba270757a36b05b776253391debcef50d65c.tar.bz2 hurd-cd19ba270757a36b05b776253391debcef50d65c.zip |
1999-07-09 Thomas Bushnell, BSG <tb@mit.edu>
* dev.c (dev_open): Use mmap instead of vm_allocate.
(dev_read): Likewise.
Diffstat (limited to 'storeio/dev.c')
-rw-r--r-- | storeio/dev.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/storeio/dev.c b/storeio/dev.c index 70347c7c..4c7b63da 100644 --- a/storeio/dev.c +++ b/storeio/dev.c @@ -154,8 +154,9 @@ dev_open (struct store_parsed *name, int flags, int inhibit_cache, return err; } - if (vm_allocate (mach_task_self (), - (vm_address_t *)&new->buf, new->store->block_size, 1)) + new->buf = mmap (0, new->store->block_size, PROT_READ|PROT_WRITE, + MAP_ANON, 0, 0); + if (new->buf == (void *) -1) { store_free (new->store); free (new); @@ -373,9 +374,9 @@ dev_read (struct dev *dev, off_t offs, size_t whole_amount, error_t err; if (*len < whole_amount) { - err = vm_allocate (mach_task_self (), - (vm_address_t *)buf, whole_amount, 1); - if (! err) + *buf = mmap (0, whole_amount, PROT_READ|PROT_WRITE, + MAP_ANON, 0, 0); + if (*buf != (void *) -1) allocated_buf = 1; } else |