summaryrefslogtreecommitdiff
path: root/libstore
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2014-11-09 22:38:22 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-11-09 22:38:22 +0100
commit84172a2e26fd81c1c39b6301b003cc89b97ee75c (patch)
tree77a4d8ab1640859e5e47aa1e4793373537857005 /libstore
parent94b2c453829b3aebdaccf7d3d252136b283002b3 (diff)
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. * libstore/memobj.c (memobj_read): Make sure to set *buf to 0 before calling vm_map.
Diffstat (limited to 'libstore')
-rw-r--r--libstore/memobj.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libstore/memobj.c b/libstore/memobj.c
index 0d5c816e..cc6c7cac 100644
--- a/libstore/memobj.c
+++ b/libstore/memobj.c
@@ -133,6 +133,7 @@ memobj_read (struct store *store,
if (((size_t) addr & (vm_page_size - 1)) == 0)
{
*len = amount;
+ *buf = 0;
return vm_map (mach_task_self (), (vm_address_t *) buf, amount,
0, 1, store->port, addr << store->log2_block_size, 0,
VM_PROT_READ, VM_PROT_ALL, VM_INHERIT_NONE);