summaryrefslogtreecommitdiff
path: root/usermux
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1999-07-11 05:32:55 +0000
committerThomas Bushnell <thomas@gnu.org>1999-07-11 05:32:55 +0000
commit251871b4158facbd4c92baf45b0456fdcc82cbb6 (patch)
treec92408e91dad29c173ec05378d5a92a26ba6d4cb /usermux
parent19b72e1976be3b741e393c0dce1da57f4bd912ee (diff)
1999-07-09 Thomas Bushnell, BSG <tb@mit.edu>
* mux.c (get_dirents): Use mmap instead of vm_allocate. (netfs_get_dirents): Likewise.
Diffstat (limited to 'usermux')
-rw-r--r--usermux/ChangeLog5
-rw-r--r--usermux/mux.c6
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 <sys/mman.h> for munmap decl.
+1999-07-09 Thomas Bushnell, BSG <tb@mit.edu>
+
+ * mux.c (get_dirents): Use mmap instead of vm_allocate.
+ (netfs_get_dirents): Likewise.
+
1999-07-03 Thomas Bushnell, BSG <tb@mit.edu>
* 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);