summaryrefslogtreecommitdiff
path: root/LibC/stdlib.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-11-08 11:37:01 +0100
committerAndreas Kling <awesomekling@gmail.com>2018-11-08 11:40:58 +0100
commitfdbd9f1e272b97d7d28f9f610be8fbf0bdbd98d9 (patch)
tree5caafbf80252f8116a6921d7498d5d56a21481fb /LibC/stdlib.cpp
parent41a751c90c9d39db764308aeba476db593b9b6e1 (diff)
downloadserenity-fdbd9f1e272b97d7d28f9f610be8fbf0bdbd98d9.zip
Start working on memory-mapped files.
First of all, change sys$mmap to take a struct SC_mmap_params since our sycsall calling convention can't handle more than 3 arguments. This exposed a bug in Syscall::invoke() needing to use clobber lists. It was a bit confusing to debug. :^)
Diffstat (limited to 'LibC/stdlib.cpp')
-rw-r--r--LibC/stdlib.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/LibC/stdlib.cpp b/LibC/stdlib.cpp
index fa6c91fb4c..342ab92e2f 100644
--- a/LibC/stdlib.cpp
+++ b/LibC/stdlib.cpp
@@ -18,7 +18,7 @@ static byte* endptr = nullptr;
void __malloc_init()
{
- nextptr = (byte*)mmap(nullptr, mallocBudget);
+ nextptr = (byte*)mmap(nullptr, mallocBudget, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
endptr = nextptr + mallocBudget;
int rc = set_mmap_name(nextptr, mallocBudget, "malloc");
if (rc < 0)