1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:07:34 +00:00

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.
This commit is contained in:
Andreas Kling 2020-12-29 02:11:47 +01:00
parent c1360ef22e
commit 30dbe9c78a
6 changed files with 71 additions and 1 deletions

View file

@ -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;
}
}