diff options
author | Andreas Kling <kling@serenityos.org> | 2020-12-29 02:11:47 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-29 02:20:43 +0100 |
commit | 30dbe9c78a50e98befe1e6fa331aaa46ab60a162 (patch) | |
tree | c85d776ae59aaede4362fa005b64fcefff44b666 /Kernel/VM | |
parent | c1360ef22e1bf0a3e8745d63ad4f07b13d3acd2c (diff) | |
download | serenity-30dbe9c78a50e98befe1e6fa331aaa46ab60a162.zip |
Kernel+LibC: Add a very limited sys$mremap() implementation
This syscall can currently only remap a shared file-backed mapping into
a private file-backed mapping.
Diffstat (limited to 'Kernel/VM')
-rw-r--r-- | Kernel/VM/Region.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Kernel/VM/Region.h b/Kernel/VM/Region.h index a81bcd9693..575b595186 100644 --- a/Kernel/VM/Region.h +++ b/Kernel/VM/Region.h @@ -238,4 +238,16 @@ inline unsigned prot_to_region_access_flags(int prot) return access; } +inline int region_access_flags_to_prot(unsigned access) +{ + int prot = 0; + if (access & Region::Access::Read) + prot |= PROT_READ; + if (access & Region::Access::Write) + prot |= PROT_WRITE; + if (access & Region::Access::Execute) + prot |= PROT_EXEC; + return prot; +} + } |