From 2f652a42e50c5c5d3eb29cd1b2ebd78e6e003d82 Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Mon, 11 Feb 2002 14:28:02 +0000 Subject: [PATCH] - vm_acquire_fixed: Fix memset() and vm_protect() calls so that the address is really the one specified instead of always zero. --- BasiliskII/src/Unix/vm_alloc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BasiliskII/src/Unix/vm_alloc.cpp b/BasiliskII/src/Unix/vm_alloc.cpp index 3c08e73c..97407d8d 100644 --- a/BasiliskII/src/Unix/vm_alloc.cpp +++ b/BasiliskII/src/Unix/vm_alloc.cpp @@ -136,7 +136,7 @@ int vm_acquire_fixed(void * addr, size_t size) return -1; // Since I don't know the standard behavior of mmap(), zero-fill here - if (memset(0, 0, size) != 0) + if (memset(addr, 0, size) != 0) return -1; #else // Unsupported @@ -146,7 +146,7 @@ int vm_acquire_fixed(void * addr, size_t size) // Explicitely protect the newly mapped region here because on some systems, // say MacOS X, mmap() doesn't honour the requested protection flags. - if (vm_protect(0, size, VM_PAGE_DEFAULT) != 0) + if (vm_protect(addr, size, VM_PAGE_DEFAULT) != 0) return -1; return 0;