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. :^)
This commit is contained in:
Andreas Kling 2018-11-08 11:37:01 +01:00
commit fdbd9f1e27
Notes: sideshowbarker 2024-07-19 18:31:47 +09:00
14 changed files with 82 additions and 26 deletions

View file

@ -32,7 +32,7 @@ void setpwent()
perror("open /etc/passwd");
}
assert(__pwdb_stream);
__pwdb_entry = (struct passwd_with_strings*)mmap(nullptr, getpagesize());
__pwdb_entry = (struct passwd_with_strings*)mmap(nullptr, getpagesize(), PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
set_mmap_name(__pwdb_entry, getpagesize(), "setpwent");
}
}