From 94b2c453829b3aebdaccf7d3d252136b283002b3 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 9 Nov 2014 22:31:21 +0100 Subject: Deal with odd kernel behavior Some versions of gnumach actually take address as a mapping hint, and would fail if the hint is bogus. Make sure to pass 0 for those versions. * console/pager.c (user_pager_create): Make sure to set *user to 0 before calling vm_map. * libdiskfs/disk-pager.c (diskfs_start_disk_pager): Make sure to set *image to 0 before calling vm_map. * libpager/pager-memcpy.c (pager_memcpy): Set window to 0 before calling vm_map. * tmpfs/node.c (diskfs_get_filemap): Make sure to set np->dn->u.reg.memref to 0 before calling vm_map. --- tmpfs/node.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tmpfs/node.c') diff --git a/tmpfs/node.c b/tmpfs/node.c index acc029ae..8835e3fd 100644 --- a/tmpfs/node.c +++ b/tmpfs/node.c @@ -508,6 +508,7 @@ diskfs_get_filemap (struct node *np, vm_prot_t prot) /* XXX we need to keep a reference to the object, or GNU Mach will terminate it when we release the map. */ + np->dn->u.reg.memref = 0; vm_map (mach_task_self (), &np->dn->u.reg.memref, 4096, 0, 1, np->dn->u.reg.memobj, 0, 0, VM_PROT_NONE, VM_PROT_NONE, VM_INHERIT_NONE); -- cgit v1.2.3