summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-11-23 11:44:14 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-23 11:44:42 +0100
commitdd6e73176d8a12ce84f6d981f7284197f39f8a93 (patch)
tree178042982841b9a9da5f8df27c0f3fad235d0ab9 /Kernel
parenta62d16fbe9704a4985dc819e4c63805cee85be3e (diff)
downloadserenity-dd6e73176d8a12ce84f6d981f7284197f39f8a93.zip
Kernel: Make sys$mmap() interpret 0-alignment as page-sized alignment
This allows userspace to get a sane default behavior without having to specify the page size.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Syscalls/mmap.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Syscalls/mmap.cpp b/Kernel/Syscalls/mmap.cpp
index 1b3e99b755..e7dd72ad59 100644
--- a/Kernel/Syscalls/mmap.cpp
+++ b/Kernel/Syscalls/mmap.cpp
@@ -128,7 +128,7 @@ ErrorOr<FlatPtr> Process::sys$mmap(Userspace<const Syscall::SC_mmap_params*> use
FlatPtr addr = params.addr;
auto size = params.size;
- auto alignment = params.alignment;
+ auto alignment = params.alignment ? params.alignment : PAGE_SIZE;
auto prot = params.prot;
auto flags = params.flags;
auto fd = params.fd;