From 251871b4158facbd4c92baf45b0456fdcc82cbb6 Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Sun, 11 Jul 1999 05:32:55 +0000 Subject: 1999-07-09 Thomas Bushnell, BSG * mux.c (get_dirents): Use mmap instead of vm_allocate. (netfs_get_dirents): Likewise. --- usermux/ChangeLog | 5 +++++ usermux/mux.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/usermux/ChangeLog b/usermux/ChangeLog index 60b59995..1ec5dacb 100644 --- a/usermux/ChangeLog +++ b/usermux/ChangeLog @@ -2,6 +2,11 @@ * mux.c: Add #include for munmap decl. +1999-07-09 Thomas Bushnell, BSG + + * mux.c (get_dirents): Use mmap instead of vm_allocate. + (netfs_get_dirents): Likewise. + 1999-07-03 Thomas Bushnell, BSG * mux.c (get_dirents): Use munmap instead of vm_deallocate. diff --git a/usermux/mux.c b/usermux/mux.c index 9c75eac5..92fd6292 100644 --- a/usermux/mux.c +++ b/usermux/mux.c @@ -101,7 +101,8 @@ get_dirents (struct node *dir, { size_t size = (max_data_len == 0 ? DIRENTS_CHUNK_SIZE : max_data_len); - err = vm_allocate (mach_task_self (), (vm_address_t *) data, size, 1); + *data = mmap (0, size, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); + err = (data != (void *) -1) ? errno : 0; if (! err) { @@ -257,7 +258,8 @@ netfs_get_dirents (struct iouser *cred, struct node *dir, *data_len = bytes_left; *data_entries = entries_left; - err = vm_allocate (mach_task_self (), (vm_address_t *)data, bytes_left, 1); + *data = mmap (0, bytes_left, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); + err = (*data == (void *) -1) ? errno : 0; if (! err) bcopy (cached_data, *data, bytes_left); -- cgit v1.2.3