diff options
author | Thomas Bushnell <thomas@gnu.org> | 1999-07-11 05:32:34 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1999-07-11 05:32:34 +0000 |
commit | e2d7e4852ab842d893675e56e6f48871b73371dc (patch) | |
tree | a14286236e8d7ae1f86a2d0098569224b4277c81 /trans | |
parent | 405d07e1e45eb3aec2aec7149f4b9f9fa70d9843 (diff) |
1999-07-09 Thomas Bushnell, BSG <tb@mit.edu>
* firmlink.c (trivfs_S_io_read): Use mmap instead of vm_allocate.
Diffstat (limited to 'trans')
-rw-r--r-- | trans/ChangeLog | 4 | ||||
-rw-r--r-- | trans/firmlink.c | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/trans/ChangeLog b/trans/ChangeLog index 88d09c5a..34a5128e 100644 --- a/trans/ChangeLog +++ b/trans/ChangeLog @@ -2,6 +2,10 @@ * crash.c: Add #include <sys/mman.h> for munmap decl. +1999-07-09 Thomas Bushnell, BSG <tb@mit.edu> + + * firmlink.c (trivfs_S_io_read): Use mmap instead of vm_allocate. + 1999-07-03 Thomas Bushnell, BSG <tb@mit.edu> * crash.c (stop_pgrp): Use munmap instead of vm_deallocate. diff --git a/trans/firmlink.c b/trans/firmlink.c index 568316dc..faf269f4 100644 --- a/trans/firmlink.c +++ b/trans/firmlink.c @@ -1,6 +1,6 @@ /* A translator for `firmlinks' - Copyright (C) 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. Written by Miles Bader <miles@gnu.ai.mit.edu> @@ -218,7 +218,9 @@ trivfs_S_io_read (struct trivfs_protid *cred, if (start + amount > max) amount = max - start; if (amount > *data_len) - err = vm_allocate (mach_task_self (), data, amount, 1); + *data = (vm_address_t) mmap (0, amount, PROT_READ|PROT_WRITE, + MAP_ANON, 0, 0); + err = (*data == -1) ? errno : 0; if (!err && amount > 0) { memcpy ((char *)(*data + start), target, amount); |