summaryrefslogtreecommitdiff
path: root/libpager
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1999-07-11 05:30:24 +0000
committerThomas Bushnell <thomas@gnu.org>1999-07-11 05:30:24 +0000
commit0f3b1a1fd2f4cdb2ad800c92858ffe64c6d3e294 (patch)
tree98abd65de0899fbc6ba5bc50c4751daf2dfd9f38 /libpager
parent511d0368972e61018b20e1debbefea04264fcd08 (diff)
1999-07-09 Thomas Bushnell, BSG <tb@mit.edu>
* pagemap.c (_pager_pagemap_resize): Use mmap instead of vm_allocate.
Diffstat (limited to 'libpager')
-rw-r--r--libpager/ChangeLog4
-rw-r--r--libpager/pagemap.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/libpager/ChangeLog b/libpager/ChangeLog
index 47c93342..268f9ddb 100644
--- a/libpager/ChangeLog
+++ b/libpager/ChangeLog
@@ -3,6 +3,10 @@
* priv.h: Add #include <sys/mman.h> for munmap decl.
* pager-memcpy.c: Likewise.
+1999-07-09 Thomas Bushnell, BSG <tb@mit.edu>
+
+ * pagemap.c (_pager_pagemap_resize): Use mmap instead of vm_allocate.
+
1999-07-03 Thomas Bushnell, BSG <tb@mit.edu>
* data-return.c (_pager_do_write_request): Use munmap instead of
diff --git a/libpager/pagemap.c b/libpager/pagemap.c
index 459f854f..c6d924c7 100644
--- a/libpager/pagemap.c
+++ b/libpager/pagemap.c
@@ -31,7 +31,8 @@ _pager_pagemap_resize (struct pager *p, vm_address_t off)
void *newaddr;
int newsize = round_page (off);
- err = vm_allocate (mach_task_self (), (u_int *)&newaddr, newsize, 1);
+ newaddr = mmap (0, newsize, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
+ err = (newaddr == (void *) -1) ? errno : 0;
if (! err)
{
bcopy (p->pagemap, newaddr, p->pagemapsize);